Browse Source

Update demo script in README

Jules Latsague 6 years ago
parent
commit
2b1acb8cc1
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      README.md

+ 7
- 5
README.md View File

@@ -12,11 +12,13 @@ Le script fournit permet de génerer le script d'intercession
12 12
 
13 13
 ```
14 14
 #!/bin/sh
15
-if [ "$(cat ~/.gitagile | grep $(basename -s .git `/usr/lib/git-core/git config --get remote.origin.url`))" ]; then
16
-    if [ "$1" = "push" ]; then
17
-        if [ "$(/usr/lib/git-core/git branch | grep '^* master')" ] || [ "$(/usr/lib/git-core/git branch | grep '^* sprint-')" ]; then
18
-            /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"
19
-            exit
15
+if [ -d .git ]; then
16
+    if [ "$(cat ~/.gitagile | grep $(basename -s .git `/usr/lib/git-core/git config --get remote.origin.url`))" ]; then
17
+        if [ "$1" = "push" ]; then
18
+            if [ "$(/usr/lib/git-core/git branch | grep '^* master')" ] || [ "$(/usr/lib/git-core/git branch | grep '^* sprint-')" ]; then
19
+                /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"
20
+                exit
21
+            fi
20 22
         fi
21 23
     fi
22 24
 fi

Loading…
Cancel
Save