diff --git a/Config/HugoExample/files/main.sh b/Config/HugoExample/files/main.sh index 75bad27..7a78f39 100644 --- a/Config/HugoExample/files/main.sh +++ b/Config/HugoExample/files/main.sh @@ -13,6 +13,14 @@ echo "DEV=$DEV" echo "*** Creating Git Repo ***" 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 ***" sudo -u hugo /var/www/hugo/cronjob.sh