From 206d492f6d0b2ef24e4c5ef55cfcca479d44873a Mon Sep 17 00:00:00 2001 From: dmullis Date: Fri, 21 Jun 2024 23:39:31 -0700 Subject: [PATCH] Address complaints from `shellcheck` --- pre-push.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pre-push.sh b/pre-push.sh index d865ec3..e5f6f64 100755 --- a/pre-push.sh +++ b/pre-push.sh @@ -12,14 +12,14 @@ set -x usage () { set +x printf "%s\n\n" "$*" - printf "usage: %s [-w]\n" ${0##*/} - printf "\t%s\t%s\n" "" - printf "\t%s\t%s\n" "$*" + printf "usage: %s [-w]\n" "${0##*/}" + printf "\t%s\n" "" + printf "\t%s\n" "$*" exit 1 } TEST_ARGS= -while getopts hg:iw flag +while getopts h:w flag do case $flag in h) usage "";; @@ -36,7 +36,7 @@ GITHUB_REPOSITORY_OWNER=$USER CURRENT_BRANCH_NAME=$(git-branch --show-current) # If the current branch name contains the GitHub username of the owner of the upstream repo, # assume the intention is to prepare and push a pull request. -if [ $(expr $CURRENT_BRANCH_NAME : ".*$UPSTREAM_OWNER") != 0 ] +if [ $(expr "$CURRENT_BRANCH_NAME" : ".*$UPSTREAM_OWNER") != 0 ] then GITHUB_REPOSITORY_OWNER=$UPSTREAM_OWNER fi