41 lines
647 B
Bash
Executable file
41 lines
647 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [ ! -f /data/gitit.conf ]; then
|
|
echo "Building config for gitit"
|
|
gitit --print-default-config > /data/gitit.conf
|
|
|
|
sed -i 's|default-extension: page|default-extension: md|' /data/gitit.conf
|
|
fi
|
|
|
|
## Check existing variables
|
|
if [ -z "$GITIT_USER_EMAIL" ]; then
|
|
exit 1
|
|
fi
|
|
if [ -z "$GITIT_USER_NAME" ]; then
|
|
exit 1
|
|
fi
|
|
|
|
# Configure GIT
|
|
CUR="$(pwd)"
|
|
cd /data/wikidata
|
|
|
|
if [ ! -d /data/wikidata/.git ]; then
|
|
git init
|
|
fi
|
|
git config diff.renames false
|
|
|
|
|
|
git config --global user.email "$GITIT_USER_EMAIL"
|
|
git config --global user.name "$GITIT_USER_NAME"
|
|
|
|
cd "$CUR"
|
|
|
|
if [ "$1" = 'gitit' ]; then
|
|
exec gitit "$@"
|
|
fi
|
|
|
|
|
|
exec "$@"
|
|
|