File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- set -x
2
+ # set -x
3
3
4
4
# #######################################################
5
5
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ if [ " $1 " == " " ]; then
4
+ echo " Please specify your git repo directory to install the hook"
5
+ exit 1
6
+ else
7
+ GIT_REPO_DIR=" $1 "
8
+ fi
3
9
4
10
echo " Enable git templates"
5
11
git config --global init.templatedir " $HOME /.git-templates"
@@ -11,9 +17,10 @@ cp pre-push ~/.git-templates/hooks
11
17
12
18
# DIR="~/" # for production
13
19
# DIR="/tmp/" # for testing
14
- echo -e " \nFind all the git repos under $DIR directory"
20
+ echo -e " \nFind all the git repos under $GIT_REPO_DIR directory"
15
21
# ALL_GIT_REPOS=$(find ~/ -name .git | sed 's/\.git//g')
16
- ALL_GIT_REPOS=$( find /tmp/ -name .git | sed ' s/\.git//g' )
22
+ # ALL_GIT_REPOS=$(find /tmp/ -name .git | sed 's/\.git//g')
23
+ ALL_GIT_REPOS=$( find $GIT_REPO_DIR -name .git | sed ' s/\.git//g' )
17
24
18
25
for repo in $ALL_GIT_REPOS ; do
19
26
echo -e " \nRunning git init on $repo under $DIR to copy the global hook" ;
You can’t perform that action at this time.
0 commit comments