mirror of
https://github.com/dtzp555-max/ocp.git
synced 2026-07-22 05:25:08 +00:00
fix(setup): rescue the semicolon from the comment; assert the child SAW the override
Two review nits on the way in. setup.mjs:393 — the statement's semicolon had been swallowed INTO the trailing comment, so the line parsed only because ASI rescued it (the next token is `if` on a new line). The repo has no linter, so nothing would have caught it. Comment moved above the statement. test-features.mjs — negative control on the prod-gate probe. The reviewer noticed the test's robustness was INCIDENTAL: because the child env is spread from process.env, it inherits the parent's own OCP_DIR_OVERRIDE, so a future refactor that renamed the var and missed this test's explicit `env` object would still have gone red — but by luck, not by assertion. The child now prints the override it SAW as well as the store it opened, and the test asserts both. The claim is now 'a prod process saw the override and ignored it', not merely 'a prod process opened the right store' (which could pass for the wrong reason). Mutation re-proven after both edits: delete the NODE_ENV gate -> 319 passed, 1 failed; restore -> 320 passed, 0 failed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VqgWJcjxrjjL9L9SkpZyXR
This commit is contained in:
@@ -390,7 +390,9 @@ if (!DRY_RUN) {
|
||||
// and "ocp-proxy" keeps the proxy invisible to that heuristic.
|
||||
const OCP_HOME = join(HOME, ".ocp");
|
||||
const ocpLogsDir = join(OCP_HOME, "logs");
|
||||
if (!existsSync(ocpLogsDir)) mkdirSync(ocpLogsDir, { recursive: true, mode: 0o700 }) // 0700: this call can create ~/.ocp itself on a fresh install;
|
||||
// mode 0700: with `recursive`, this call can create ~/.ocp ITSELF on a fresh install, and
|
||||
// without an explicit mode that parent lands at the umask default (world-listable 0755).
|
||||
if (!existsSync(ocpLogsDir)) mkdirSync(ocpLogsDir, { recursive: true, mode: 0o700 });
|
||||
|
||||
// Uninstall legacy service names if present (upgrade path)
|
||||
if (platform === "darwin") {
|
||||
|
||||
Reference in New Issue
Block a user