Avoid passing empty args to node scripts

Make wrapper scripts omit the "${ARGS[@]}" expansion when no arguments are supplied. Each script now checks if ARGS is empty and invokes node with only the script path if so. Affects: scripts/install-for-current-provider.sh, scripts/launch-ui.sh, scripts/restore-codex-config.sh, scripts/start-gateway.sh, and scripts/stop-gateway.sh. This prevents an empty positional parameter from being passed to the .mjs entrypoints.
This commit is contained in:
掌星
2026-06-26 12:28:11 +08:00
parent ae25b664d3
commit 441061fe5e
5 changed files with 25 additions and 5 deletions
+5 -1
View File
@@ -29,4 +29,8 @@ if command -v node.exe >/dev/null 2>&1; then
done
ARGS=("${NORMALIZED_ARGS[@]}")
fi
"$NODE_BIN" "$SCRIPT_DIR/install-for-current-provider.mjs" "${ARGS[@]}"
if [[ ${#ARGS[@]} -eq 0 ]]; then
"$NODE_BIN" "$SCRIPT_DIR/install-for-current-provider.mjs"
else
"$NODE_BIN" "$SCRIPT_DIR/install-for-current-provider.mjs" "${ARGS[@]}"
fi