fix(mac): scope restart log by worktree

This commit is contained in:
Vincent Koc
2026-06-02 04:10:39 +02:00
parent 793ab78ebb
commit 883c0f1254
2 changed files with 10 additions and 1 deletions

View File

@@ -15,7 +15,7 @@ LOCK_KEY="$(printf '%s' "${ROOT_DIR}" | shasum -a 256 | cut -c1-8)"
LOCK_DIR="${TMPDIR:-/tmp}/openclaw-restart-${LOCK_KEY}"
LOCK_PID_FILE="${LOCK_DIR}/pid"
WAIT_FOR_LOCK=0
LOG_PATH="${OPENCLAW_RESTART_LOG:-/tmp/openclaw-restart.log}"
LOG_PATH="${OPENCLAW_RESTART_LOG:-${TMPDIR:-/tmp}/openclaw-restart-${LOCK_KEY}.log}"
NO_SIGN=0
SIGN=0
AUTO_DETECT_SIGNING=1

View File

@@ -74,6 +74,15 @@ describe("scripts/restart-mac.sh", () => {
expect(script).not.toContain("lsof -iTCP:${GATEWAY_PORT} -sTCP:LISTEN | head -n 5 || true");
});
it("keeps the default restart log scoped to the current worktree lock", () => {
const script = readFileSync(restartScriptPath, "utf8");
expect(script).toContain(
'LOG_PATH="${OPENCLAW_RESTART_LOG:-${TMPDIR:-/tmp}/openclaw-restart-${LOCK_KEY}.log}"',
);
expect(script).not.toContain('LOG_PATH="${OPENCLAW_RESTART_LOG:-/tmp/openclaw-restart.log}"');
});
it("prefers the freshly packaged app unless an explicit app bundle is set", () => {
const script = readFileSync(restartScriptPath, "utf8");
const chooseBlock = script.slice(