commit c9402fb97193c6a6235ec5d59abb544971c4a377
parent 9c22b66afdccf6ca6e3ba69886a6e7ff60c48c67
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Thu, 28 Dec 2023 09:24:24 +0300
bootstrap: added fallback for uncrustify conf installation
Diffstat:
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/bootstrap b/bootstrap
@@ -32,18 +32,24 @@ if have_command uncrustify; then
if test -f uncrustify.cfg; then
echo "Uncrustify configuration already exists, skipping installation from the upstream file."
else
- echo "Installing configuration"
- ln -s contrib/uncrustify.cfg uncrustify.cfg
+ echo "Installing libmicrohttpd uncrustify configuration"
+ ln -s contrib/uncrustify.cfg uncrustify.cfg || \
+ cp contrib/uncrustify.cfg uncrustify.cfg || \
+ echo "Failed to install uncrustify configuration file" 1>&2
fi
- if test -d '.git'; then
- if test -f .git/hooks/pre-commit; then
- echo "Pre-commit git hook already exists, skipping installation from the upstream file."
+ if test -f uncrustify.cfg; then
+ if test -d '.git'; then
+ if test -f .git/hooks/pre-commit; then
+ echo "Pre-commit git hook already exists, skipping installation from the upstream file."
+ else
+ echo "Installing uncrustify pre-commit git hook"
+ ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit || \
+ cp ../../contrib/uncrustify_precommit .git/hooks/pre-commit || \
+ echo "Failed to install pre-commit git hook" 1>&2
+ fi
else
- echo "Installing uncrustify pre-commit git hook"
- ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit
+ echo "No '.git' directory found, skipping installation of pre-commit git hook."
fi
- else
- echo "No '.git' directory found, skipping installation of pre-commit git hook."
fi
else
echo "Uncrustify not detected, hook not installed. Please install uncrustify if you plan on doing development."