aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorziggys <ziggys@autistici.org>2018-07-16 17:42:57 -0400
committerziggys <ziggys@autistici.org>2018-07-16 17:42:57 -0400
commit0df5d4e44660ee03dc0fb25f9af16407842cf63a (patch)
tree2d116ad2022e13898a5d831b3e420d5226a15023
parentd30e2aa48ef8402f9ca27650262809022667e252 (diff)
downloadgc2gs-0df5d4e44660ee03dc0fb25f9af16407842cf63a.tar
gc2gs-0df5d4e44660ee03dc0fb25f9af16407842cf63a.zip
Check syntaxHEADmaster
-rwxr-xr-xgc2gs.sh24
1 files changed, 16 insertions, 8 deletions
diff --git a/gc2gs.sh b/gc2gs.sh
index 24abf97..c7c5d7d 100755
--- a/gc2gs.sh
+++ b/gc2gs.sh
@@ -89,10 +89,16 @@ configure () {
printf "\\ndo you want to configure a 'pre-push' 'git hook'? (yes/no): " \
&& read -r HOOKANS
- test "${HOOKANS}" = "no" \
- && printf "done!\\n" \
- && exit "${?}" \
- || hook_config
+
+ case "${HOOKANS}" in
+ n | no | N | NO | No )
+ printf "done!\\n"
+ exit "$?"
+ ;;
+ y | yes | Y | YES | Yes )
+ hook_config
+ ;;
+ esac
}
# configure a pre-push git hook
@@ -100,10 +106,12 @@ hook_config () {
sed 's/nullconfname/'"${CONFNAME}"'/' "${SNIPPET}" > "$CPREPUSH"
printf "\\nConfiguring a 'pre-push' 'git hook' for %s\\n" "${CONFNAME}"
- test ! -d "${REPOPATH}" \
- && printf "\\n%s is not a directory... exiting" "${REPOPATH}" \
- && exit "${?}" \
- || isgit
+ if [ ! -d "${REPOPATH}" ]; then
+ printf "\\n%s is not a directory... exiting" "${REPOPATH}"
+ exit "$?"
+ else
+ isgit
+ fi
test ! -z "${ISGIT}" \
&& chmod +x "${CPREPUSH}" \