Skip to content

Commit 0a76a03

Browse files
committed
test: more debug
1 parent a9ae5cd commit 0a76a03

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

scripts/examples-generate.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,20 @@ for dir in "$ROOT_DIR"/examples/*/; do
5555
echo "-> Debug: node $(node --version 2>/dev/null || echo 'node-not-found')"
5656
echo "-> Debug: pnpm $(pnpm --version 2>/dev/null || echo 'pnpm-not-found')"
5757
echo "-> Debug: pwd $(pwd)"
58-
echo "-> Running pnpm exec for openapi-ts (workspace-aware if available)"
59-
# Use `pnpm -w exec` when available so the CLI binary from the workspace is resolved in CI
60-
if pnpm -w -s --version >/dev/null 2>&1; then
61-
pnpm -w -s exec openapi-ts
58+
echo "-> Running pnpm run openapi-ts (invokes package script in example)"
59+
# Run the example's package script so pnpm resolves the workspace binary correctly
60+
# Use silent mode to keep logs concise but preserve errors
61+
echo "--- begin openapi-ts output ---"
62+
if pnpm -s --version >/dev/null 2>&1; then
63+
pnpm -s run openapi-ts || rc=$?
6264
else
63-
pnpm -s exec openapi-ts
65+
pnpm run openapi-ts || rc=$?
66+
fi
67+
rc=${rc:-0}
68+
echo "--- end openapi-ts output (rc=$rc) ---"
69+
if [ "$rc" -ne 0 ]; then
70+
echo "openapi-ts failed with exit code $rc"
71+
exit $rc
6472
fi
6573

6674
# Format generated files in this example only to keep the step fast

0 commit comments

Comments
 (0)