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:
@@ -29,4 +29,8 @@ if command -v node.exe >/dev/null 2>&1; then
|
||||
done
|
||||
ARGS=("${NORMALIZED_ARGS[@]}")
|
||||
fi
|
||||
"$NODE_BIN" "$SCRIPT_DIR/stop-gateway.mjs" "${ARGS[@]}"
|
||||
if [[ ${#ARGS[@]} -eq 0 ]]; then
|
||||
"$NODE_BIN" "$SCRIPT_DIR/stop-gateway.mjs"
|
||||
else
|
||||
"$NODE_BIN" "$SCRIPT_DIR/stop-gateway.mjs" "${ARGS[@]}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user