From e0c98b860a7b6ddfad2703b2b25dc1cc74614152 Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Tue, 6 Feb 2018 15:14:10 +0000 Subject: [PATCH] Updated commit script. --- commit | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/commit b/commit index 8e298de97..c7d959f02 100755 --- a/commit +++ b/commit @@ -7,13 +7,12 @@ COMMITMSG="none" COMMITTYPE="none" BUMP="false" PUSH="false" -ALL="false" -FLAGS="-a" +ALL="true" # Parse CLI arguments / options -USAGE1="commit [-F ] [-m ] [-p] [-b]" +USAGE1="commit [-F ] [-m ] [-p] [-b] [-o]" -while getopts "F:m:bpn" options; do +while getopts "F:m:bpo" options; do case $options in F ) COMMITFILE=$OPTARG COMMITTYPE="file" @@ -23,10 +22,10 @@ while getopts "F:m:bpn" options; do echo "Using supplied text for commit message.";; b ) BUMP="true" echo "Version (patch) number will be bumped.";; + o ) ALL="false" + echo "Only specific changes will be committed.";; p ) PUSH="true" echo "Files will be committed and local changes pushed to server.";; - n ) FLAGS="" - echo "Manual mode enabled - no changes will be added automatically to the commit.";; \? ) echo -e $USAGE1 exit 1;; * ) echo -e $USAGE1 @@ -34,6 +33,13 @@ while getopts "F:m:bpn" options; do esac done +# Set up flags to pass +FLAGS="" +if [ "$ALL" = "true" ] +then + FLAGS="$FLAGS -a" +fi + # Check that a commit type was given if [ "$COMMITTYPE" = "none" ] then