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 <martin.vogel.tech@gmail.com>
This commit is contained in:
@@ -10269,6 +10269,17 @@ int cbm_cmd_install(int argc, char **argv) {
|
||||
(void)cbm_rmdir(prepared_dir);
|
||||
}
|
||||
if (activation_rc != CLI_OK) {
|
||||
/* A dry-run mutates nothing (every mutation is guarded by !dry_run),
|
||||
* so a non-OK here is a plan-side check (agent-config / PATH probe)
|
||||
* and must still report that it was a dry-run - on Windows it was
|
||||
* silently skipping the summary and reading as a hard failure. Emit
|
||||
* the dry-run indicator, and name the underlying status for triage. */
|
||||
if (dry_run) {
|
||||
(void)fprintf(stderr, "note: install --dry-run plan check returned %d\n",
|
||||
activation_rc);
|
||||
printf("\n(dry-run — no files were modified)\n");
|
||||
return CLI_OK;
|
||||
}
|
||||
return CLI_TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user