docs: clarify APP_CMD legacy and APP_CMD_ARGS contract
All checks were successful
Gitea CI / test (push) Successful in 36s
Gitea CI / test (pull_request) Successful in 36s

This commit is contained in:
agentson
2026-03-04 02:43:32 +09:00
parent dc0775cbc6
commit bcbbf80d16

View File

@@ -14,6 +14,16 @@ APP_CMD_BIN="${APP_CMD_BIN:-}"
APP_CMD_ARGS="${APP_CMD_ARGS:-}" APP_CMD_ARGS="${APP_CMD_ARGS:-}"
RUNS_DASHBOARD="false" RUNS_DASHBOARD="false"
# Custom override contract:
# 1) Preferred: APP_CMD_BIN + APP_CMD_ARGS
# - APP_CMD_BIN is treated as a single executable token.
# - APP_CMD_ARGS uses shell-style word splitting; quote/escape inside this
# variable is NOT preserved as a nested shell parse.
# 2) Legacy fallback: APP_CMD (raw shell command string)
# - This path remains for backward compatibility.
# - When APP_CMD includes --dashboard, caller should include explicit
# DASHBOARD_PORT assignment in APP_CMD if non-default port is required.
if [ -n "$APP_CMD_BIN" ]; then if [ -n "$APP_CMD_BIN" ]; then
USE_DEFAULT_APP_CMD="false" USE_DEFAULT_APP_CMD="false"
USE_SAFE_CUSTOM_APP_CMD="true" USE_SAFE_CUSTOM_APP_CMD="true"
@@ -100,6 +110,7 @@ elif [ "$USE_SAFE_CUSTOM_APP_CMD" = "true" ]; then
else else
# Custom APP_CMD is treated as a shell command string. # Custom APP_CMD is treated as a shell command string.
# If executable paths include spaces, they must be quoted inside APP_CMD. # If executable paths include spaces, they must be quoted inside APP_CMD.
# Legacy compatibility path: caller owns quoting and env var injection.
nohup bash -lc "exec env $APP_CMD" >>"$RUN_LOG" 2>&1 & nohup bash -lc "exec env $APP_CMD" >>"$RUN_LOG" 2>&1 &
fi fi
app_pid=$! app_pid=$!