File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22echo ' Running commit script'
3+
4+ IGNORED_BRANCHES=(" dev" " master" " qa" " uat" " staging" )
5+
36CURRENT_BRANCH_CMD=" git rev-parse --abbrev-ref HEAD"
47CURRENT_BRANCH=$( eval $CURRENT_BRANCH_CMD )
58
69COMMIT_WITH_BRANCH=" git commit -m \" $CURRENT_BRANCH : $1 \" "
710DEFAULT_COMMIT=" git commit -m \" $1 \" "
11+ IS_IGNORED=false
12+
13+ for branch in " ${IGNORED_BRANCHES[@]} " ;
14+ do
15+ if [ " $CURRENT_BRANCH " == ignore ]
16+ then
17+ IS_IGNORED=true
18+ break
19+ fi
20+ done
821
9- if [ " $CURRENT_BRANCH " != " dev " ] && [ " $CURRENT_BRANCH " != " master " ] && [ " $CURRENT_BRANCH " != " qa " ] && [ " $CURRENT_BRANCH " != " uat " ] && [ " $CURRENT_BRANCH " != " staging " ]
22+ if [ " $IS_IGNORED " == false ]
1023then
1124 echo " Commiting with branch name-> $CURRENT_BRANCH "
1225 eval $COMMIT_WITH_BRANCH
Original file line number Diff line number Diff line change 1+ dev
2+ uat
3+ master
4+ EF-223
You can’t perform that action at this time.
0 commit comments