Put quotes around potentially empty bash variables

This commit is contained in:
Cameron Sparr 2015-08-13 15:38:05 -06:00
parent 0e65d8e64e
commit b199d7a9fe
1 changed files with 6 additions and 6 deletions

View File

@ -224,7 +224,7 @@ EOF
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
usage 1 usage 1
elif [ $1 == "-h" ]; then elif [ "$1" == "-h" ]; then
usage 0 usage 0
else else
VERSION=$1 VERSION=$1
@ -232,11 +232,11 @@ fi
echo -e "\nStarting package process...\n" echo -e "\nStarting package process...\n"
if [ $CIRCLE_BRANCH == "" ]; then if [ "$CIRCLE_BRANCH" == "" ]; then
check_gvm check_gvm
fi fi
check_gopath check_gopath
if [ $CIRCLE_BRANCH == "" ]; then if [ "$CIRCLE_BRANCH" == "" ]; then
check_clean_tree check_clean_tree
update_tree update_tree
fi fi
@ -282,7 +282,7 @@ generate_postinstall_script $VERSION
########################################################################### ###########################################################################
# Create the actual packages. # Create the actual packages.
if [ $CIRCLE_BRANCH == "" ]; then if [ "$CIRCLE_BRANCH" == "" ]; then
echo -n "Commence creation of $ARCH packages, version $VERSION? [Y/n] " echo -n "Commence creation of $ARCH packages, version $VERSION? [Y/n] "
read response read response
response=`echo $response | tr 'A-Z' 'a-z'` response=`echo $response | tr 'A-Z' 'a-z'`
@ -323,7 +323,7 @@ echo "Debian package created successfully."
########################################################################### ###########################################################################
# Offer to tag the repo. # Offer to tag the repo.
if [ $CIRCLE_BRANCH == "" ]; then if [ "$CIRCLE_BRANCH" == "" ]; then
echo -n "Tag source tree with v$VERSION and push to repo? [y/N] " echo -n "Tag source tree with v$VERSION and push to repo? [y/N] "
read response read response
response=`echo $response | tr 'A-Z' 'a-z'` response=`echo $response | tr 'A-Z' 'a-z'`
@ -347,7 +347,7 @@ fi
########################################################################### ###########################################################################
# Offer to publish the packages. # Offer to publish the packages.
if [ $CIRCLE_BRANCH == "" ]; then if [ "$CIRCLE_BRANCH" == "" ]; then
echo -n "Publish packages to S3? [y/N] " echo -n "Publish packages to S3? [y/N] "
read response read response
response=`echo $response | tr 'A-Z' 'a-z'` response=`echo $response | tr 'A-Z' 'a-z'`