From 8035af77d428eb524d8abb3150e7451f54723ce9 Mon Sep 17 00:00:00 2001 From: Shaun Struwig <41984034+Blargian@users.noreply.github.com> Date: Fri, 28 Nov 2025 18:34:13 +0100 Subject: [PATCH] troubleshooting change --- scripts/autogenerate-table-of-contents.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/autogenerate-table-of-contents.sh b/scripts/autogenerate-table-of-contents.sh index d1dbab22419..5a9752ad908 100644 --- a/scripts/autogenerate-table-of-contents.sh +++ b/scripts/autogenerate-table-of-contents.sh @@ -5,8 +5,8 @@ # - landing pages # - indexing of the knowledgebase -# Don't exit on errors - we want to collect them all -set +e +# During environment setup fail fast on errors +set -e # Function to cleanup on exit cleanup() { @@ -21,11 +21,12 @@ trap cleanup EXIT USE_VENV=false -# Try to create a venv, if that fails fall back to installing packages +# Try to create a venv, if that fails fall back to installing package if [ ! -d "venv" ]; then echo "Creating virtual environment..." if python3 -m venv venv 2>/tmp/venv_err.log; then USE_VENV=true + echo "Using virtualenv at ./venv" else echo "Warning: could not create venv, falling back to user site-packages." cat /tmp/venv_err.log @@ -33,16 +34,22 @@ if [ ! -d "venv" ]; then fi else USE_VENV=true + echo "Reusing existing virtualenv at ./venv" fi if [ "$USE_VENV" = true ]; then . venv/bin/activate + echo "Installing requirements into virtualenv..." pip install -r scripts/table-of-contents-generator/requirements.txt else - # No working venv, install deps + echo "No working venv, installing requirements with python3 -m pip --user..." python3 -m pip install --user -r scripts/table-of-contents-generator/requirements.txt fi +# From here on don't exit on the first error, we want to collect which +# TOC commands succeed and which fail. +set +e + # Define all TOC generation commands COMMANDS=( '--dir="knowledgebase" --single-toc --out="static" --ignore images'