Skip to content

Commit b70ee76

Browse files
authored
Merge pull request #783 from constructive-io/fix/no-tty-flag-parsing
fix(cli): fix --no-tty flag not being recognized in init command
2 parents 0b191a2 + e4682da commit b70ee76

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pgpm/cli/src/commands/init/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async function handleInit(argv: Partial<Record<string, any>>, prompter: Inquirer
7474
const { cwd = process.cwd() } = argv;
7575
const templateRepo = (argv.repo as string) ?? DEFAULT_TEMPLATE_REPO;
7676
const branch = argv.fromBranch as string | undefined;
77-
const noTty = Boolean((argv as any).noTty || argv['no-tty'] || process.env.CI === 'true');
77+
const noTty = Boolean((argv as any).noTty || argv['no-tty'] || argv.tty === false || process.env.CI === 'true');
7878
const useBoilerplatePrompt = Boolean(argv.boilerplate);
7979
const createWorkspace = Boolean(argv.createWorkspace || argv['create-workspace'] || argv.w);
8080

@@ -413,7 +413,7 @@ async function handleModuleInit(
413413
}
414414

415415
if (!resolvedWorkspacePath) {
416-
const noTty = Boolean((argv as any).noTty || argv['no-tty'] || process.env.CI === 'true');
416+
const noTty = Boolean((argv as any).noTty || argv['no-tty'] || argv.tty === false || process.env.CI === 'true');
417417

418418
// Handle --create-workspace flag: create workspace first, then module
419419
if (ctx.createWorkspace && (workspaceType === 'pgpm' || workspaceType === 'pnpm')) {

pgpm/cli/src/commands/init/workspace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default async function runWorkspaceSetup(
5454
workspaceName: answers.name
5555
},
5656
toolName: DEFAULT_TEMPLATE_TOOL_NAME,
57-
noTty: Boolean((argv as any).noTty || argv['no-tty'] || process.env.CI === 'true'),
57+
noTty: Boolean((argv as any).noTty || argv['no-tty'] || argv.tty === false || process.env.CI === 'true'),
5858
cwd,
5959
prompter
6060
});

0 commit comments

Comments
 (0)