Skip to content

Commit

Permalink
fix(core): skip nx cloud prompt when interactive is false
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Nov 15, 2024
1 parent 3c6c387 commit 9f82455
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/create-nx-workspace/src/internal-utils/prompts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import * as yargs from 'yargs';
import * as enquirer from 'enquirer';
import * as chalk from 'chalk';

import { MessageKey, messages } from '../utils/nx/ab-testing';
import { output } from '../utils/output';
import { deduceDefaultBase } from '../utils/git/default-base';
Expand All @@ -8,14 +11,15 @@ import {
packageManagerList,
} from '../utils/package-manager';
import { stringifyCollection } from '../utils/string-utils';
import enquirer = require('enquirer');
import { NxCloud } from '../utils/nx/nx-cloud';
import chalk = require('chalk');
import { isCI } from '../utils/ci/is-ci';

export async function determineNxCloud(
parsedArgs: yargs.Arguments<{ nxCloud: NxCloud }>
): Promise<NxCloud> {
if (parsedArgs.nxCloud === undefined) {
if (!parsedArgs.interactive || isCI()) {
return 'skip';
} else if (parsedArgs.nxCloud === undefined) {
return nxCloudPrompt('setupCI');
} else {
return parsedArgs.nxCloud;
Expand Down Expand Up @@ -80,6 +84,7 @@ export async function determineDefaultBase(
message: `Main branch name`,
initial: `main`,
type: 'input',
skip: !parsedArgs.interactive || isCI(),
},
])
.then((a) => {
Expand Down Expand Up @@ -130,6 +135,7 @@ export async function determinePackageManager(
{ name: 'pnpm', message: 'PNPM' },
{ name: 'bun', message: 'Bun' },
],
skip: !parsedArgs.interactive || isCI(),
},
])
.then((a) => a.packageManager);
Expand Down

0 comments on commit 9f82455

Please sign in to comment.