Add safeguards to cron job so that website does not get deleted without having replacement files.
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
|
||||
cd /var/www/hugo/site
|
||||
|
||||
git pull
|
||||
|
||||
hugo --gc --minify
|
||||
git pull && hugo --gc --minify
|
||||
status="$?"
|
||||
|
||||
if [[ $status == 0 && -e public/* ]]; then
|
||||
rm -rfv /var/www/html/*
|
||||
cp -rfv public/* /var/www/html/
|
||||
mv -rfv public/* /var/www/html/
|
||||
fi
|
||||
|
Reference in New Issue
Block a user