Remove hugo user reference from files.

This commit is contained in:
2025-08-17 11:49:05 -07:00
parent f622cba366
commit d7a1e6f58a
3 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
cd /var/www/hugo/site
echo "*** Running cronjob @ `date` ***"
# Pull any updates, and if the project is already up to date, exit successfully.
git pull | grep -v "up to date"
status="$?"
echo "* Pull status is '$status'."
if [[ $status != 0 && -e /var/www/html/index.html ]]; then
echo "* Site is already up to date and copied, exiting."
exit 0
fi
# If the project was not already up to date, build the new files for NGINX.
hugo --gc --minify
status="$?"
echo "* Hugo status is '$status'."
if [[ $status == 0 && -e public/index.html ]]; then
echo "* Copying files..."
rm -rfv /var/www/html/*
mv -v public/* /var/www/html/
fi
exit 0