Skip to content

Commit

Permalink
feat: "foundation new" does not prompt when stdout is not a tty
Browse files Browse the repository at this point in the history
this allows running foundation new in e2e tests or automation
  • Loading branch information
JohannesRudolph committed Sep 24, 2023
1 parent df86e0a commit 8d357c4
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/commands/foundation/new.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,17 @@ export function registerNewCmd(program: TopLevelCommand) {
.action(
async (opts: GlobalCommandOptions, foundationArg: string | undefined) => {
const foundation: string = foundationArg ||
await Input.prompt(
`Choose a name for your new foundation`,
);
(await Input.prompt(`Choose a name for your new foundation`));
const repo = await CollieRepository.load();
const logger = new Logger(repo, opts);

const foundationPath = repo.resolvePath("foundations", foundation);

const factory = new CliApiFacadeFactory(logger);

const platformEntries = await promptPlatformEntries(
foundation,
factory,
);
const platformEntries = Deno.isatty(Deno.stdout.rid)
? await promptPlatformEntries(foundation, factory)
: [];

const dir = new DirectoryGenerator(WriteMode.skip, logger);
const d: Dir = {
Expand Down

0 comments on commit 8d357c4

Please sign in to comment.