Skip to content

Commit 8035af7

Browse files
authored
troubleshooting change
1 parent 44c9e33 commit 8035af7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

scripts/autogenerate-table-of-contents.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
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
1212
cleanup() {
@@ -21,28 +21,35 @@ trap cleanup EXIT
2121

2222
USE_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
2525
if [ ! -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
3435
else
3536
USE_VENV=true
37+
echo "Reusing existing virtualenv at ./venv"
3638
fi
3739

3840
if [ "$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
4144
else
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
4447
fi
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
4754
COMMANDS=(
4855
'--dir="knowledgebase" --single-toc --out="static" --ignore images'

0 commit comments

Comments
 (0)