55 # - landing pages
66 # - indexing of the knowledgebase
77
8- # Don't exit on errors - we want to collect them all
9- set + e
8+ # During environment setup fail fast on errors
9+ set - e
1010
1111# Function to cleanup on exit
1212cleanup () {
@@ -21,28 +21,35 @@ trap cleanup EXIT
2121
2222USE_VENV=false
2323
24- # Try to create a venv, if that fails fall back to installing packages
24+ # Try to create a venv, if that fails fall back to installing package
2525if [ ! -d " venv" ]; then
2626 echo " Creating virtual environment..."
2727 if python3 -m venv venv 2> /tmp/venv_err.log; then
2828 USE_VENV=true
29+ echo " Using virtualenv at ./venv"
2930 else
3031 echo " Warning: could not create venv, falling back to user site-packages."
3132 cat /tmp/venv_err.log
3233 rm -rf venv
3334 fi
3435else
3536 USE_VENV=true
37+ echo " Reusing existing virtualenv at ./venv"
3638fi
3739
3840if [ " $USE_VENV " = true ]; then
3941 . venv/bin/activate
42+ echo " Installing requirements into virtualenv..."
4043 pip install -r scripts/table-of-contents-generator/requirements.txt
4144else
42- # No working venv, install deps
45+ echo " No working venv, installing requirements with python3 -m pip --user... "
4346 python3 -m pip install --user -r scripts/table-of-contents-generator/requirements.txt
4447fi
4548
49+ # From here on don't exit on the first error, we want to collect which
50+ # TOC commands succeed and which fail.
51+ set +e
52+
4653# Define all TOC generation commands
4754COMMANDS=(
4855 ' --dir="knowledgebase" --single-toc --out="static" --ignore images'
0 commit comments