Created
February 23, 2024 08:45
-
-
Save finagin/21073cfb79151e124c23476668228c58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Initialize the wiki | |
if [ ! -d .git ] && [ "$(git rev-parse --is-bare-repository 2> /dev/null)" != "true" ]; then | |
# Check if the parent repository has a wiki | |
REPO=$(git --git-dir=/.git config --get remote.origin.url | sed -e 's/.git$/.wiki.git/g' -e 's/:/\//g' -e "s/git@/https:\/\/$GIT_AUTH@/g" -e "s/:\/\/@/:\/\//g") | |
[ ! -z $REPO ] \ | |
&& git clone --no-tags --single-branch --depth 1 $REPO . 2> /dev/null \ | |
|| git init 2> /dev/null | |
fi | |
# Set git user.name and user.email | |
if [ ${GOLLUM_AUTHOR_USERNAME:+1} ]; then | |
git config user.name "${GOLLUM_AUTHOR_USERNAME}" | |
fi | |
if [ ${GOLLUM_AUTHOR_EMAIL:+1} ]; then | |
git config user.email "${GOLLUM_AUTHOR_EMAIL}" | |
fi | |
# Start gollum service | |
exec gollum $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment