From 3a443e1fa516c430772a7915ec3adb78f9e1a237 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 10 Jul 2023 12:46:44 +0200 Subject: [PATCH] build.sh: fix handling git safe protection --- build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.sh b/build.sh index e0b7d15..3d2bba6 100755 --- a/build.sh +++ b/build.sh @@ -9,6 +9,12 @@ cd $( dirname $0 ) echo "Clean previous build..." rm -fr dist deb_dist +if [ -n "$CI" -a $UID -eq 0 ] +then + echo "CI environment detected, set current directory as git safe for root" + git config --global --add safe.directory $(pwd) +fi + echo "Detect version using git describe..." VERSION="$( git describe --tags|sed 's/^[^0-9]*//' )"