fix(setup): honor config roots and display terminal dry-run plans
Normalize empty XDG config homes once for configuration writers and registration readers. Render the resolved plan for terminal dry runs while preserving structured output. Cover registration placement and a real PTY dry run, including absence of configuration writes.
This commit is contained in:
@@ -11,6 +11,7 @@ import { homeDirectoryFromEnvironment } from "../config/homeDirectory.js";
|
||||
import { isUpdateFailure } from "../application/UpdateFailure.js";
|
||||
import {
|
||||
confirmInteractiveSetup,
|
||||
renderSetupDryRun,
|
||||
renderInteractiveSetupResult,
|
||||
renderSetupProgress,
|
||||
} from "./interactiveSetup.js";
|
||||
@@ -225,6 +226,8 @@ const runSetupCommand = async (
|
||||
: undefined,
|
||||
);
|
||||
if (interactive) renderInteractiveSetupResult(result, environment);
|
||||
else if (options.dryRun && !input.formatExplicit && hasInteractiveTerminal())
|
||||
renderSetupDryRun(result.plannedActions);
|
||||
return result;
|
||||
};
|
||||
|
||||
@@ -282,6 +285,9 @@ const setupIsInteractive = (
|
||||
!options.yes &&
|
||||
!options.dryRun &&
|
||||
!formatExplicit &&
|
||||
hasInteractiveTerminal();
|
||||
|
||||
const hasInteractiveTerminal = (): boolean =>
|
||||
process.stdin.isTTY === true &&
|
||||
process.stdout.isTTY === true &&
|
||||
process.stderr.isTTY === true;
|
||||
|
||||
Reference in New Issue
Block a user