From b6e7039ee16b9891e3a81c9993beb0a49d5d7916 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 20 Feb 2024 10:40:17 +0000 Subject: [PATCH] Update deploy scripts --- tools/branch-deploy.sh | 10 +++++++--- tools/retro-deploy.sh | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/branch-deploy.sh b/tools/branch-deploy.sh index 698a802..8c9de25 100755 --- a/tools/branch-deploy.sh +++ b/tools/branch-deploy.sh @@ -16,6 +16,11 @@ THEMES="lhs lhs-retro" # Ensure the target folder exists mkdir -p "${TARGET_FOLDER}" +# Clear out target folder, and put a boilerplate index in while we're building +rm -rf ${TARGET_FOLDER}/* +INDEX_PAGE="${TARGET_FOLDER}/index.html" +echo "

Deploying...

" > "${INDEX_PAGE}" + # Checkout a local bare copy, to speed up later checkouts ORIGIN=$(git config --get remote.origin.url) BARE_FOLDER=`mktemp -u -d` @@ -41,15 +46,14 @@ for BRANCH in $BRANCHES; do # Build to the destination folder for THEME in $THEMES; do hugo --quiet ${HUGO_ARGUMENTS} -b "${BASE_URL}/${BRANCH}/${THEME}" -s "${TEMP_FOLDER}" -d "${TARGET_FOLDER}/${BRANCH}/${THEME}" -t "${THEME}" + find "${TARGET_FOLDER}/${BRANCH}/${THEME}" -name "*.cgi" -exec chmod a+x {}\; done # Cleanup the temp folder rm -rf "${TEMP_FOLDER}" done -# Build the index page -INDEX_PAGE="${TARGET_FOLDER}/index.html" - +# Build the full index page echo -e "

Branches

\n