Use environement variables for user settings

This commit is contained in:
Glenn Y. Rolland 2021-01-27 15:03:28 +01:00
parent 821b7451fc
commit 846298e0a7

View file

@ -9,15 +9,26 @@ if [ ! -f /data/gitit.conf ]; then
sed -i 's|default-extension: page|default-extension: md|' /data/gitit.conf sed -i 's|default-extension: page|default-extension: md|' /data/gitit.conf
fi fi
## Check existing variables
if [ -z "$GITIT_USER_EMAIL" ]; then
exit 1
fi
if [ -z "$GITIT_USER_NAME" ]; then
exit 1
fi
# Configure GIT # Configure GIT
CUR="$(pwd)" CUR="$(pwd)"
cd /data/wikidata cd /data/wikidata
if [ ! -d /data/wikidata/.git ]; then if [ ! -d /data/wikidata/.git ]; then
git init git init
fi fi
git config diff.renames false git config diff.renames false
git config --global user.email "admin@localhost"
git config --global user.name "Admin From Localhost"
git config --global user.email "$GITIT_USER_EMAIL"
git config --global user.name "$GITIT_USER_NAME"
cd "$CUR" cd "$CUR"