create-env.sh: use GIT-default vars

This commit is contained in:
2024-04-07 17:06:02 +02:00
parent 269c095af9
commit 25c3f65111

View File

@@ -28,9 +28,12 @@ GIT_USER="$(grep "${USER}" /etc/passwd | cut -d: -f5 | sed 's/,//g')"
if git --version &>/dev/null; then
# Git is installed, try to get global values
GLOBAL_EMAIL=$(git config --global user.email)
if [ -z "$GLOBAL_EMAIL" ]; then
GLOBAL_EMAIL=$GIT_EMAIL
fi
GLOBAL_USER=$(git config --global user.name)
if [ -z "$GLOBAL_USER" ]; then
GLOBAL_USER=$USER
GLOBAL_USER=$GIT_USER
fi
# Check if inside a Git repository