Skip to content

Commit 2853405

Browse files
committed
Fix: pushd popd
1 parent 5bac489 commit 2853405

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

scripts/apidocgen/generate.sh

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,28 @@ trap cleanup EXIT
1717

1818
log "Use temporary file: ${API_MD_TMP_FILE}"
1919

20-
(
21-
cd "$SCRIPT_DIR/../.."
22-
23-
go run github.com/swaggo/swag/cmd/swag@v1.8.6 init \
20+
pushd "$SCRIPT_DIR/../.."
21+
go run github.com/swaggo/swag/cmd/swag@v1.8.6 init \
2422
--generalInfo="coderd.go" \
2523
--dir="./coderd,./codersdk" \
2624
--output="./coderd/apidoc" \
2725
--outputTypes="go,json" \
2826
--parseDependency=true
29-
) || exit $?
30-
31-
(
32-
cd "$SCRIPT_DIR"
33-
npm ci
34-
35-
# Make sure that widdershins is installed correctly.
36-
npm exec -- widdershins --version
37-
38-
# Render the Markdown file.
39-
npm exec -- widdershins \
40-
--user_templates "./markdown-template" \
41-
--search false \
42-
--omitHeader true \
43-
--language_tabs "shell:curl" \
44-
--summary "../../coderd/apidoc/swagger.json" \
45-
--outfile "${API_MD_TMP_FILE}"
46-
) || exit $?
47-
48-
(
49-
cd "$SCRIPT_DIR"
50-
go run postprocess/main.go -in-md-file-single "${API_MD_TMP_FILE}"
51-
) || exit $?
27+
popd
28+
29+
pushd "$SCRIPT_DIR"
30+
npm ci
31+
32+
# Make sure that widdershins is installed correctly.
33+
npm exec -- widdershins --version
34+
# Render the Markdown file.
35+
npm exec -- widdershins \
36+
--user_templates "./markdown-template" \
37+
--search false \
38+
--omitHeader true \
39+
--language_tabs "shell:curl" \
40+
--summary "../../coderd/apidoc/swagger.json" \
41+
--outfile "${API_MD_TMP_FILE}"
42+
# Perform the postprocessing
43+
go run postprocess/main.go -in-md-file-single "${API_MD_TMP_FILE}"
44+
popd

0 commit comments

Comments
 (0)