Check to see if stationapi is actually a repo

Existing VMs will have a stationapi directory that is not hooked up to the repo. This will cause an error because the script will see the stationapi directory but then not be able to `git pull`.  Solve this by checking for the .git directory instead. If it is missing, delete the stationapi directory and clone it from the repo. If .git is already present, go ahead and pull.
This commit is contained in:
Tekaoh
2019-04-02 09:51:32 -05:00
committed by GitHub
parent 92b545c937
commit 4b3dbd95db

View File

@@ -128,7 +128,8 @@ if [[ $response =~ ^(yes|y| ) ]]; then
git pull
cd $basedir
fi
if [ ! -d $basedir/stationapi ]; then
if [ ! -d $basedir/stationapi/.git ]; then
rm -rf $basedir/stationapi
git clone -b $GIT_REPO_STATIONAPI_BRANCH $GIT_REPO_STATIONAPI stationapi
else
cd $basedir/stationapi