We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ecb0bb0 commit b6de6f8Copy full SHA for b6de6f8
2 files changed
.commit.swp
-12 KB
commit
@@ -3,6 +3,15 @@ echo 'Running commit script'
3
4
IGNORED_BRANCHES=("dev" "master" "qa" "uat" "staging")
5
6
+IGNORED_PATH="./.ignore"
7
+if [ -f "$IGNORED_PATH" ]
8
+then
9
+ CUSTOM_BRANCHES=$(cat "$IGNORED_PATH")
10
+ BRANCHES=( $CUSTOM_BRANCHES )
11
+ IGNORED_BRANCHES=( ${IGNORED_BRANCHES[@]} ${BRANCHES[@]} )
12
+fi
13
+
14
15
CURRENT_BRANCH_CMD="git rev-parse --abbrev-ref HEAD"
16
CURRENT_BRANCH=$(eval $CURRENT_BRANCH_CMD)
17
@@ -12,13 +21,14 @@ IS_IGNORED=false
21
22
for branch in "${IGNORED_BRANCHES[@]}";
23
do
- if [ "$CURRENT_BRANCH" == ignore ]
24
+ if [ "$CURRENT_BRANCH" == $branch ]
25
then
26
IS_IGNORED=true
18
27
break
19
28
fi
20
29
done
30
31
+echo $IS_IGNORED
32
if [ "$IS_IGNORED" == false ]
33
34
echo "Commiting with branch name-> $CURRENT_BRANCH"
0 commit comments