Skip to content

Commit 89e9446

Browse files
committed
HEAD: Initial commit
0 parents  commit 89e9446

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

commit

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/bash
2+
echo 'Running commit script'
3+
CURRENT_BRANCH_CMD="git rev-parse --abbrev-ref HEAD"
4+
CURRENT_BRANCH=$(eval $CURRENT_BRANCH_CMD)
5+
6+
COMMIT_WITH_BRANCH="git commit -m \"$CURRENT_BRANCH: $1\""
7+
DEFAULT_COMMIT="git commit -m \"$1\""
8+
9+
if [ "$CURRENT_BRANCH" != "dev" ] && [ "$CURRENT_BRANCH" != "master" ] && [ "$CURRENT_BRANCH" != "qa" ] && [ "$CURRENT_BRANCH" != "uat" ]
10+
then
11+
echo "Commiting with custom branch name"
12+
eval $COMMIT_WITH_BRANCH
13+
else
14+
echo "Commiting with default branch"
15+
eval $DEFAULT_COMMIT
16+
fi

0 commit comments

Comments
 (0)