Skip to content

Commit ec51f80

Browse files
betegonclaude
andcommitted
fix: use process.stdin.isTTY with dry-run bypass
guardNonInteractive uses isatty(0) which isn't mockable in tests and has a different error message. Keep the original isTTY check but add --dry-run bypass so dry-run works non-interactively. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bff518a commit ec51f80

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/lib/init/wizard-runner.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { formatBanner } from "../banner.js";
2525
import { CLI_VERSION } from "../constants.js";
2626
import { getAuthToken } from "../db/auth.js";
2727
import { terminalLink } from "../formatters/colors.js";
28-
import { guardNonInteractive } from "../mutate-command.js";
2928
import { getSentryBaseUrl } from "../sentry-urls.js";
3029
import { slugify } from "../utils.js";
3130
import {
@@ -326,11 +325,9 @@ async function preamble(
326325
yes: boolean,
327326
dryRun: boolean
328327
): Promise<boolean> {
329-
try {
330-
guardNonInteractive({ yes, "dry-run": dryRun });
331-
} catch (err) {
328+
if (!(yes || dryRun || process.stdin.isTTY)) {
332329
process.stderr.write(
333-
`Error: ${err instanceof Error ? err.message : "Interactive mode requires a terminal. Use --yes for non-interactive mode."}\n`
330+
"Error: Interactive mode requires a terminal. Use --yes for non-interactive mode.\n"
334331
);
335332
process.exitCode = 1;
336333
return false;

0 commit comments

Comments
 (0)