Refactor git handling

This commit is contained in:
Jafner 2021-09-30 09:40:07 -07:00
parent c9defd1f64
commit 3352d0358e

View File

@ -99,9 +99,7 @@ else
elif [ $DL_TYPE = "github" ]; then # the github structure elif [ $DL_TYPE = "github" ]; then # the github structure
echo " === Using github structure to update from $DL_LINK" echo " === Using github structure to update from $DL_LINK"
echo " === Warning: images will be downloaded automatically, which will take longer" echo " === Warning: images will be downloaded automatically, which will take longer"
if [ -d "./.git" ]; then # if a git repository already exists if [ ! -d "./.git" ]; then # if no git repository already exists
git pull upstream $DL_LINK
else # if no git repository exists
git config --global user.email "autodeploy@jafner.tools" git config --global user.email "autodeploy@jafner.tools"
git config --global user.name "AutoDeploy" git config --global user.name "AutoDeploy"
git init git init
@ -109,6 +107,7 @@ else
git commit -m "Init" git commit -m "Init"
git remote add upstream $DL_LINK git remote add upstream $DL_LINK
fi fi
git pull upstream $DL_LINK
echo " === Using latest version on $DL_LINK" echo " === Using latest version on $DL_LINK"
echo " === Starting!" echo " === Starting!"
httpd-foreground httpd-foreground