Do not continue if the git repo does not exist.

This commit is contained in:
2025-08-17 09:01:24 -07:00
parent 5afc3bfaee
commit dbb54b6f81

View File

@@ -13,6 +13,14 @@ echo "DEV=$DEV"
echo "*** Creating Git Repo ***" echo "*** Creating Git Repo ***"
sudo -u hugo git clone --recurse-submodules $REPO /var/www/hugo/site sudo -u hugo git clone --recurse-submodules $REPO /var/www/hugo/site
status="$?"
echo "*** Validating Git Repo ***"
if [[ $status != 0 || ! -d /var/www/hugo/site/.git ]]; then
echo "ERROR: Hugo project may not have cloned correctly. status='$status'"
echo "Aborting."
exit 1
fi
echo "*** Copying Static Files to NGINX ***" echo "*** Copying Static Files to NGINX ***"
sudo -u hugo /var/www/hugo/cronjob.sh sudo -u hugo /var/www/hugo/cronjob.sh