File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # git-hooks-install.sh
4
+ # by wilsonmar at gmail.com
5
+ # After the repo is cloned, this bash script copies
6
+ # scripts in the repo's hooks folder into the .git/hooks
7
+ # and sets permissions.
8
+
9
+ fancy_echo () { # to add blank line between echo statements:
10
+ local fmt=" $1 " ; shift
11
+ # shellcheck disable=SC2059
12
+ printf " \n$fmt \n" " $@ "
13
+ }
14
+
15
+ fancy_echo " Remove *.sample files ..."
16
+ del .git/hooks/* .sample
17
+
18
+ fancy_echo " Copy hooks/git-commit into .git/hooks ..."
19
+ cp hooks/prepare-commit-msg .git/hooks
20
+ chmod +x .git/hooks/prepare-commit-msg
21
+
22
+ # cp hooks/git-commit .git/hooks
23
+ # chmod +x .git/hooks/git-commit
24
+
25
+ cp hooks/git-push .git/hooks
26
+ chmod +x .git/hooks/git-push
27
+
28
+ cp hooks/git-rebase .git/hooks
29
+ chmod +x .git/hooks/git-rebase
30
+
31
+ ls .git/hooks
32
+
33
+ fancy_echo " Done with status $? (0=OK)."
You can’t perform that action at this time.
0 commit comments