Skip to content

Commit 30b5f12

Browse files
committed
fix(cli): install --dry-run always reports dry-run, even on a plan check
A dry-run mutates nothing (every install mutation is guarded by !dry_run), but on Windows the activation plan's PATH/agent-config probe can return non-OK, and the caller then returned early WITHOUT the dry-run summary - so `install --dry-run` neither indicated dry-run mode nor exited success (smoke Phase 6a). For a dry-run, emit the "(dry-run — no files were modified)" indicator and return CLI_OK on that path (the plan simply noted something), and log the underlying status to stderr for triage. POSIX is unaffected (its dry-run activation returns OK, so the branch is never taken). Signed-off-by: Martin Vogel <[email protected]>
1 parent 4dc517c commit 30b5f12

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎src/cli/cli.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10269,6 +10269,17 @@ int cbm_cmd_install(int argc, char **argv) {
1026910269
(void)cbm_rmdir(prepared_dir);
1027010270
}
1027110271
if (activation_rc != CLI_OK) {
10272+
/* A dry-run mutates nothing (every mutation is guarded by !dry_run),
10273+
* so a non-OK here is a plan-side check (agent-config / PATH probe)
10274+
* and must still report that it was a dry-run - on Windows it was
10275+
* silently skipping the summary and reading as a hard failure. Emit
10276+
* the dry-run indicator, and name the underlying status for triage. */
10277+
if (dry_run) {
10278+
(void)fprintf(stderr, "note: install --dry-run plan check returned %d\n",
10279+
activation_rc);
10280+
printf("\n(dry-run — no files were modified)\n");
10281+
return CLI_OK;
10282+
}
1027210283
return CLI_TRUE;
1027310284
}
1027410285

0 commit comments

Comments
 (0)