From 6502675f2b4fc229bea5b5a526c3165daefbf0cb Mon Sep 17 00:00:00 2001 From: k4lizen <124312252+k4lizen@users.noreply.github.com> Date: Thu, 29 May 2025 11:54:56 +0200 Subject: [PATCH] make the doc scripts runnable from anywhere (#3040) --- scripts/_docs/build-all-docs.sh | 2 ++ scripts/_docs/extract-all-docs.sh | 2 ++ scripts/docs-live.sh | 2 ++ scripts/generate-docs.sh | 4 ++++ scripts/verify-docs.sh | 6 +++++- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/_docs/build-all-docs.sh b/scripts/_docs/build-all-docs.sh index 5138d1bf8..920267805 100755 --- a/scripts/_docs/build-all-docs.sh +++ b/scripts/_docs/build-all-docs.sh @@ -2,6 +2,8 @@ source "$(dirname "$0")/../common.sh" +cd $PWNDBG_ABS_PATH + # This may perform verification instead of building # depending on PWNDBG_DOCGEN_VERIFY. $UV_RUN_DOCS python ./scripts/_docs/build_command_docs.py || exit 1 diff --git a/scripts/_docs/extract-all-docs.sh b/scripts/_docs/extract-all-docs.sh index dc36ea428..18c667dd3 100755 --- a/scripts/_docs/extract-all-docs.sh +++ b/scripts/_docs/extract-all-docs.sh @@ -2,6 +2,8 @@ source "$(dirname "$0")/../common.sh" +cd $PWNDBG_ABS_PATH + # Extract from sources all the information necessary to build # the documentation. Do this from each debugger. diff --git a/scripts/docs-live.sh b/scripts/docs-live.sh index cb06916dd..6b64ea8c2 100755 --- a/scripts/docs-live.sh +++ b/scripts/docs-live.sh @@ -2,4 +2,6 @@ source "$(dirname "$0")/common.sh" +cd $PWNDBG_ABS_PATH + $UV_RUN_DOCS mkdocs serve -a 0.0.0.0:8000 diff --git a/scripts/generate-docs.sh b/scripts/generate-docs.sh index 8ac6bf57e..2da248a57 100755 --- a/scripts/generate-docs.sh +++ b/scripts/generate-docs.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +source "$(dirname "$0")/common.sh" + +cd $PWNDBG_ABS_PATH + # Extract the documentation. echo "Extracting docs.." ./scripts/_docs/extract-all-docs.sh || exit 1 diff --git a/scripts/verify-docs.sh b/scripts/verify-docs.sh index ec1985eac..12168dbc9 100755 --- a/scripts/verify-docs.sh +++ b/scripts/verify-docs.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +source "$(dirname "$0")/common.sh" + +cd $PWNDBG_ABS_PATH + # Extract the documentation. echo "Extracting docs.." ./scripts/_docs/extract-all-docs.sh || exit 1 @@ -7,4 +11,4 @@ echo "Extracting docs.." # Verify the documentation. echo "Verifying docs.." export PWNDBG_DOCGEN_VERIFY=1 -./scripts/_docs/build-all-docs.sh || exit 1 +./scripts/_docs/build-all-docs.sh || exit 2