File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66set -e
77
8+ # Check environment
9+ if [ -n " $WSL_DISTRO_NAME " ]; then
10+ # we found a non-blank WSL environment distro name
11+ current_path=" $( pwd) "
12+ pattern=" /mnt/?"
13+ if [ " $( echo " $current_path " | grep -E " ^$pattern " ) " ]; then
14+ # if we are in WSL and shared Windows file system, 'ln' does not work.
15+ no_links=true
16+ else
17+ no_links=
18+ fi
19+ fi
20+
821# Git hooks should come before autoreconf.
922if test -d .git; then
10- if ! test -d .git/hooks; then
11- mkdir .git/hooks
12- fi
13- ln -s -f ../../pre-commit.sh .git/hooks/pre-commit
23+ if [ -n " $no_links " ]; then
24+ echo " Linux ln does not work on shared Windows file system in WSL."
25+ if [ ! -e .git/hooks/pre-commit ]; then
26+ echo " The pre-commit.sh file will not be copied to .git/hooks/pre-commit"
27+ # shell scripts do not work on Windows; TODO create equivalent batch file
28+ # cp ./pre-commit.sh .git/hooks/pre-commit || exit $?
29+ fi
30+ if [ ! -e .git/hooks/pre-push ]; then
31+ echo " The pre-push.sh file will not be copied to .git/hooks/pre-commit"
32+ # shell scripts do not work on Windows; TODO create equivalent batch file
33+ # cp ./pre-push.sh .git/hooks/pre-push || exit $?
34+ fi
35+ else
36+ if ! test -d .git/hooks; then
37+ mkdir .git/hooks
38+ fi
39+ ln -s -f ../../pre-commit.sh .git/hooks/pre-commit
40+ fi
1441fi
1542
1643# if get an error about libtool not setup
You can’t perform that action at this time.
0 commit comments