mirror of https://github.com/wolfSSL/wolfTPM.git
Merge pull request #352 from gojimmypi/PR-autogen-fix
fix autogen.sh for WSL/Windows git hook file link attemptpull/354/head
commit
2a845082bf
35
autogen.sh
35
autogen.sh
|
@ -5,12 +5,39 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Check environment
|
||||||
|
if [ -n "$WSL_DISTRO_NAME" ]; then
|
||||||
|
# we found a non-blank WSL environment distro name
|
||||||
|
current_path="$(pwd)"
|
||||||
|
pattern="/mnt/?"
|
||||||
|
if [ "$(echo "$current_path" | grep -E "^$pattern")" ]; then
|
||||||
|
# if we are in WSL and shared Windows file system, 'ln' does not work.
|
||||||
|
no_links=true
|
||||||
|
else
|
||||||
|
no_links=
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Git hooks should come before autoreconf.
|
# Git hooks should come before autoreconf.
|
||||||
if test -d .git; then
|
if test -d .git; then
|
||||||
if ! test -d .git/hooks; then
|
if [ -n "$no_links" ]; then
|
||||||
mkdir .git/hooks
|
echo "Linux ln does not work on shared Windows file system in WSL."
|
||||||
fi
|
if [ ! -e .git/hooks/pre-commit ]; then
|
||||||
ln -s -f ../../pre-commit.sh .git/hooks/pre-commit
|
echo "The pre-commit.sh file will not be copied to .git/hooks/pre-commit"
|
||||||
|
# shell scripts do not work on Windows; TODO create equivalent batch file
|
||||||
|
# cp ./pre-commit.sh .git/hooks/pre-commit || exit $?
|
||||||
|
fi
|
||||||
|
if [ ! -e .git/hooks/pre-push ]; then
|
||||||
|
echo "The pre-push.sh file will not be copied to .git/hooks/pre-commit"
|
||||||
|
# shell scripts do not work on Windows; TODO create equivalent batch file
|
||||||
|
# cp ./pre-push.sh .git/hooks/pre-push || exit $?
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if ! test -d .git/hooks; then
|
||||||
|
mkdir .git/hooks
|
||||||
|
fi
|
||||||
|
ln -s -f ../../pre-commit.sh .git/hooks/pre-commit
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if get an error about libtool not setup
|
# if get an error about libtool not setup
|
||||||
|
|
Loading…
Reference in New Issue