aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2019-12-15 12:52:45 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2019-12-15 12:52:45 -0800
commit0171d2ac54c7bd829dba9a98c4387ab733408a3f (patch)
treede6aab04ddad0e5300e968d9efef362174e5fd47
parentlocal/update*: ensure correct handling for add/del branch/tags (diff)
downloadgithooks-0171d2ac54c7bd829dba9a98c4387ab733408a3f.tar.gz
githooks-0171d2ac54c7bd829dba9a98c4387ab733408a3f.tar.bz2
githooks-0171d2ac54c7bd829dba9a98c4387ab733408a3f.zip
local: autofixing from shellcheckgithooks-20191215T205245Z
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xlocal/post-receive2
-rwxr-xr-xlocal/pre-receive2
-rwxr-xr-xlocal/update.secondary4
-rw-r--r--local/update.secondary.d/puppet-validate14
4 files changed, 11 insertions, 11 deletions
diff --git a/local/post-receive b/local/post-receive
index c6fc859..b5a1511 100755
--- a/local/post-receive
+++ b/local/post-receive
@@ -13,6 +13,6 @@ stdin=$(cat)
for hook in ${HOOKS[@]}; do
if [[ -x ${hook} ]]; then
- echo "${stdin}" | ./${hook}
+ echo "${stdin}" | ./"${hook}"
fi
done
diff --git a/local/pre-receive b/local/pre-receive
index f2268a2..0b56e32 100755
--- a/local/pre-receive
+++ b/local/pre-receive
@@ -9,7 +9,7 @@ stdin=$(cat)
for hook in $HOOKS; do
if [ -x "${hook}" ]; then
- echo "${stdin}" | ./$hook
+ echo "${stdin}" | ./"$hook"
fi
done
diff --git a/local/update.secondary b/local/update.secondary
index 7366b76..e021472 100755
--- a/local/update.secondary
+++ b/local/update.secondary
@@ -35,8 +35,8 @@ do
# call the hooklet with the same arguments we got
"$i" "$@" || {
# hooklet failed; we need to log it...
- echo hooklet $i failed
- perl -I$GL_BINDIR -Mgitolite -e "log_it('hooklet $i failed')"
+ echo hooklet "$i" failed
+ perl -I"$GL_BINDIR" -Mgitolite -e "log_it('hooklet $i failed')"
# ...and send back some non-zero exit code ;-)
exit 1
}
diff --git a/local/update.secondary.d/puppet-validate b/local/update.secondary.d/puppet-validate
index b2ca015..e6b1689 100644
--- a/local/update.secondary.d/puppet-validate
+++ b/local/update.secondary.d/puppet-validate
@@ -29,11 +29,11 @@ tmp=$(mktemp /tmp/git.update.XXXXXX)
log=$(mktemp /tmp/git.update.log.XXXXXX)
tree=$(mktemp /tmp/git.diff-tree.XXXXXX)
-git diff-tree -r "$2" "$3" > $tree
+git diff-tree -r "$2" "$3" > "$tree"
echo
echo diff-tree:
-cat $tree
+cat "$tree"
exit_status=0
@@ -44,18 +44,18 @@ while read old_mode new_mode old_sha1 new_sha1 status name; do
[ "$new_sha1" = "0000000000000000000000000000000000000000" ] && continue
# Only test .pp files
if [[ $name =~ [.]pp$ ]]; then
- git cat-file blob $new_sha1 > $tmp
+ git cat-file blob "$new_sha1" > "$tmp"
set -o pipefail
- $syntax_check $tmp 2>&1 | sed "s|$tmp|$name|"> $log
+ $syntax_check "$tmp" 2>&1 | sed "s|$tmp|$name|"> "$log"
if [[ $? != 0 ]]; then
echo
- echo -e "$(cat $log | sed 's|JOJOMOJO|'\\${RED}${name}\\${NOBOLD}'|')" >&2
+ echo -e "$(cat "$log" | sed 's|JOJOMOJO|'\\"${RED}""${name}"\\"${NOBOLD}"'|')" >&2
echo -e "For more details run this: ${CYAN} git diff $old_sha1 $new_sha1 ${NOBOLD}" >&2
echo
exit_status=1
fi
fi
-done < $tree
+done < "$tree"
-rm -f $log $tmp $tree
+rm -f "$log" "$tmp" "$tree"
exit $exit_status