|
@@ -78,14 +78,16 @@ create_liste() {
|
78
|
78
|
deploy() {
|
79
|
79
|
mv $GIT_PATH $GIT_PATH.bk
|
80
|
80
|
echo "#!/bin/sh
|
81
|
|
-if [ \"\$(cat ~/.gitagile | grep \$(basename -s .git `/usr/lib/git-core/git config --get remote.origin.url`))\" ]; then
|
82
|
|
- if [ \"\$1\" = \"push\" ]; then
|
83
|
|
- if [ \"\$(/usr/lib/git-core/git branch | grep \'^* master\')\" ] || [ \"\$(/usr/lib/git-core/git branch | grep \'^* sprint-\')\" ]; then
|
84
|
|
- \/bin\/echo -e \"033[1;31m ⚠ Current branch is protected.\033[0m\\\nNo push allowed\\\nSee $PROTECT_LIST to change it or bypass it in invocating $GIT_APP_PATH \\\n\"
|
85
|
|
- exit
|
|
81
|
+if [ -d .git ]; then
|
|
82
|
+ if [ \"\$(cat ~/.gitagile | grep \$(basename -s .git `/usr/lib/git-core/git config --get remote.origin.url`))\" ]; then
|
|
83
|
+ if [ \"\$1\" = \"push\" ]; then
|
|
84
|
+ if [ \"\$(/usr/lib/git-core/git branch | grep \'^* master\')\" ] || [ \"\$(/usr/lib/git-core/git branch | grep \'^* sprint-\')\" ]; then
|
|
85
|
+ \/bin\/echo -e \"033[1;31m ⚠ Current branch is protected.\033[0m\\\nNo push allowed\\\nSee $PROTECT_LIST to change it or bypass it in invocating $GIT_APP_PATH \\\n\"
|
|
86
|
+ exit
|
|
87
|
+ fi
|
86
|
88
|
fi
|
87
|
89
|
fi
|
88
|
|
-fi
|
|
90
|
+fi
|
89
|
91
|
$GIT_APP_PATH \$@" > $GIT_PATH
|
90
|
92
|
}
|
91
|
93
|
|