- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit-msg
More file actions
Latest commit
executable file
·36 lines (30 loc) · 1.03 KB
/
Copy pathcommit-msg
File metadata and controls
executable file
·36 lines (30 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
############################################################
# Variable
############################################################
os_version=$(uname -s)
dir=`pwd`
###############################################################
# Function
###############################################################
## Commit 格式校驗 ##
validateCommitMsg(){
echo"run validateCommitMsg..."
cmd_linux=$dir/.githooks/validate-commit-msg-linux
cmd_windows=$dir/.githooks/validate-commit-msg-win.exe
if [[ $os_version=~"Linux" ]];then
echo"linux"
$cmd_linux"`cat .git/COMMIT_EDITMSG`"
elif [[ $os_version=~"MINGW" ]];then
echo"Windows"
$cmd_windows"`cat .git/COMMIT_EDITMSG`"
elif [[ $os_version=~"Darwin" ]];then
echo"Mac OS X"
$cmd_linux"`cat .git/COMMIT_EDITMSG`"
fi
}
###############################################################
# Main Content
###############################################################
## validateCommitMsg ##
validateCommitMsg