|
start-server.sh built SESSION_DIR, PID_FILE, LOG_FILE and BRAINSTORM_DIR
from --project-dir as given, then ran `cd "$SCRIPT_DIR"` before using
them. A relative project dir like `.` was re-rooted at the scripts
directory, so the log and pid redirects failed and the server never
reported server-started: "Server failed to start within 5 seconds".
Resolve the project dir to an absolute path with `mkdir -p` + `cd && pwd`
right before deriving the session paths. mkdir -p keeps the existing
behavior of creating a project dir that doesn't exist yet (the Windows
lifecycle test relies on it), CDPATH is cleared so a relative name can't
resolve to some other directory, and `--` covers names starting with a
dash. Works on bash 3.2 without realpath or readlink -f.
Fixes #2524.
Claude-Session: https://claude.ai/code/session_01SHANcr4A71nzuU9et4Fnba
|