mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Merge pull request #6798 from gojimmypi/autogen-update-wsl-pr
no WSL/Windows git hooks from autogen.sh
This commit is contained in:
38
autogen.sh
38
autogen.sh
@ -3,16 +3,44 @@
|
|||||||
# Create configure and makefile stuff...
|
# Create configure and makefile stuff...
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# 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 [ -d .git ]; then
|
if [ -d .git ]; then
|
||||||
if [ ! -d .git/hooks ]; then
|
if [ ! -d .git/hooks ]; then
|
||||||
mkdir .git/hooks || exit $?
|
mkdir .git/hooks || exit $?
|
||||||
fi
|
fi
|
||||||
if [ ! -e .git/hooks/pre-commit ]; then
|
|
||||||
ln -s ../../pre-commit.sh .git/hooks/pre-commit || exit $?
|
if [ -n "$no_links" ]; then
|
||||||
fi
|
echo "Linux ln does not work on shared Windows file system in WSL."
|
||||||
if [ ! -e .git/hooks/pre-push ]; then
|
if [ ! -e .git/hooks/pre-commit ]; then
|
||||||
ln -s ../../pre-push.sh .git/hooks/pre-push || exit $?
|
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 [ ! -e .git/hooks/pre-commit ]; then
|
||||||
|
ln -s ../../pre-commit.sh .git/hooks/pre-commit || exit $?
|
||||||
|
fi
|
||||||
|
if [ ! -e .git/hooks/pre-push ]; then
|
||||||
|
ln -s ../../pre-push.sh .git/hooks/pre-push || exit $?
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user