Skip to content

Commit

Permalink
Test for number of script arguments to be 1 after shifting options
Browse files Browse the repository at this point in the history
  • Loading branch information
datag committed Dec 2, 2012
1 parent 9473048 commit 7346b37
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gitwatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ shelp () { # Print a message about how to use this script
echo "is specified."
}

if [ -z $1 ]; then
shelp
exit
fi

while getopts b:hp: option
do
case "${option}" in
Expand All @@ -62,6 +57,11 @@ done

shift $((OPTIND-1)) # Shift the input arguments, so that the input file (last arg) is $1 in the code below

if [ $# -ne 1 ]; then
shelp
exit
fi

# Check for both git and inotifywait and generate an error
# if either don't exist or you cannot run them

Expand Down

0 comments on commit 7346b37

Please sign in to comment.