diff --git a/git_01_quick_commit.sh b/git_01_quick_commit.sh index c9d582a..2076b3e 100755 --- a/git_01_quick_commit.sh +++ b/git_01_quick_commit.sh @@ -2,6 +2,9 @@ TIMESTAMP=`date "+%Y%m%d%H%M"` -git_99_status.sh +TEST=$(git_99_status.sh) -git commit -m "$TIMESTAMP" +if [ ! "$TEST" = "GIT STATUS OK" ] +then + git commit -m "$TIMESTAMP" +fi diff --git a/git_99_status.sh b/git_99_status.sh index 1d55920..79d24c2 100755 --- a/git_99_status.sh +++ b/git_99_status.sh @@ -1,7 +1,7 @@ #!/bin/env bash -TEST=`git status | grep propre | wc -l` -if [ $TEST -eq 0 ] +TEST1=`git status | grep propre | wc -l` +if [ $TEST1 -eq 0 ] then echo "La branche actuelle ($GIT_CURRENT_BRANCH) n'est pas propre" @@ -20,6 +20,10 @@ then then git add . fi -else +fi + +TEST2=`git status | grep propre | wc -l` +if [ $TEST1 -eq 1 ] +then echo "GIT STATUS OK" fi