浏览代码

Update demo script in README

Jules Latsague 6 年前
父节点
当前提交
2b1acb8cc1
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7
    5
      README.md

+ 7
- 5
README.md 查看文件

@@ -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

正在加载...
取消
保存