MCPcopy Create free account
hub / github.com/Snapchat/Valdi / finalConfirmation

Function finalConfirmation

npm_modules/cli/src/commands/newModule.ts:185–205  ·  view source on GitHub ↗
(destPath: string, argv: ArgumentsResolver<CommandParameters>)

Source from the content-addressed store, hash-verified

183}
184
185async function finalConfirmation(destPath: string, argv: ArgumentsResolver<CommandParameters>): Promise<boolean> {
186 return argv.getArgumentOrResolve('skipChecks', async () => {
187 const confirmMessage = `
188Create module?
189 Path: ${wrapInColor(destPath, ANSI_COLORS.GREEN_COLOR)}
190`;
191 const answers = await inquirer.prompt<{ confirm?: boolean }>(
192 [
193 {
194 type: 'confirm',
195 name: 'confirm',
196 message: confirmMessage,
197 default: true,
198 },
199 ],
200 {},
201 );
202
203 return answers.confirm ?? false;
204 });
205}
206
207function getBazelWorkspaceRoot() {
208 return new BazelClient().getWorkspaceRoot();

Callers 1

valdiNewModuleFunction · 0.85

Calls 2

wrapInColorFunction · 0.90
getArgumentOrResolveMethod · 0.80

Tested by

no test coverage detected