From 3352d0358e41e67a5f697283d24706900aeacabe Mon Sep 17 00:00:00 2001 From: Jafner <40403594+Jafner@users.noreply.github.com> Date: Thu, 30 Sep 2021 09:40:07 -0700 Subject: [PATCH] Refactor git handling --- 5etools-docker/init.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/5etools-docker/init.sh b/5etools-docker/init.sh index 10ff5bf6..ef7a658d 100644 --- a/5etools-docker/init.sh +++ b/5etools-docker/init.sh @@ -99,9 +99,7 @@ else elif [ $DL_TYPE = "github" ]; then # the github structure echo " === Using github structure to update from $DL_LINK" echo " === Warning: images will be downloaded automatically, which will take longer" - if [ -d "./.git" ]; then # if a git repository already exists - git pull upstream $DL_LINK - else # if no git repository exists + if [ ! -d "./.git" ]; then # if no git repository already exists git config --global user.email "autodeploy@jafner.tools" git config --global user.name "AutoDeploy" git init @@ -109,6 +107,7 @@ else git commit -m "Init" git remote add upstream $DL_LINK fi + git pull upstream $DL_LINK echo " === Using latest version on $DL_LINK" echo " === Starting!" httpd-foreground