roles/blog: fix updateBlog

This commit is contained in:
CPunch 2023-01-17 17:52:47 -06:00
parent 41ef83bb4e
commit 1747125b67

View File

@ -15,14 +15,18 @@ LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")
if [ $LOCAL = $REMOTE ]; then
# this string is hardcoded && checked by the 'Build blog' task
# to check for changes (changed_when)
echo "up to date"
elif [ $LOCAL = $BASE ]; then
# there are changes to reset too
# && we need to update our blog
# there are changes to reset too so we need to rebuild
echo "missing changes !!"
git reset --hard origin/main
buildBlog
elif [ ! -d "$PUBLIC_DIR" ] || [ ! -d "$TOR_DIR" ]; then
echo "missing directories..."
fi
if [ ! -d "$PUBLIC_DIR" ] || [ ! -d "$TOR_DIR" ]; then
# probably first time setup
echo "missing directories !!"
buildBlog
fi