We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d20d34 commit 468bb01Copy full SHA for 468bb01
1 file changed
githooks/branch_validate.sh
@@ -1,16 +1,19 @@
1
-#!/usr/bin/env bash
+#!/bin/sh -e
2
LC_ALL=C
3
4
+NOCOLOR="\033[0m"
5
+RED="\033[0;31m"
6
+
7
local_branch="$(git rev-parse --abbrev-ref HEAD)"
8
9
valid_branch_regex="^(bug|chore|devops|feat|fix|hotfix|release)\/[a-zA-Z0-9._-]+$"
10
-message="Commit failed. Branch names in this project must adhere to this contract: $valid_branch_regex. Please rename your branch and try again."
11
+message="Commit failed. Branch names in this project must follow this pattern: $valid_branch_regex. Please rename your branch and try again."
12
13
if [[ ! $local_branch =~ $valid_branch_regex ]]
14
then
- echo "$message"
15
+ echo ${RED}$message${NOCOLOR}
16
exit 1
17
fi
18
-exit 0
19
+exit 0
0 commit comments