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

Function getApplicationType

npm_modules/cli/src/commands/bootstrap.ts:78–97  ·  view source on GitHub ↗
(argv: ArgumentsResolver<CommandParameters>)

Source from the content-addressed store, hash-verified

76const defaultProjectName = path.basename(process.cwd());
77
78async function getApplicationType(argv: ArgumentsResolver<CommandParameters>): Promise<ApplicationTemplate> {
79 const applicationType = argv.getArgument('applicationType');
80
81 if (applicationType) {
82 const target = ALL_APPLICATION_TEMPLATES.find(target => target.path === applicationType);
83
84 if (target) {
85 return target;
86 } else {
87 throw new CliError(`Unknown application type: ${applicationType}`);
88 }
89 }
90
91 const choices: CliChoice<ApplicationTemplate>[] = ALL_APPLICATION_TEMPLATES.map(target => ({
92 name: `${wrapInColor(target.name, ANSI_COLORS.GREEN_COLOR)} . ${target.description}`,
93 value: target,
94 }));
95
96 return await getUserChoice(choices, `Please choose the application type:`);
97}
98
99async function getProjectName(argv: ArgumentsResolver<CommandParameters>): Promise<string> {
100 return argv.getArgumentOrResolve('projectName', async () => {

Callers 1

valdiBootstrapFunction · 0.85

Calls 5

wrapInColorFunction · 0.90
getUserChoiceFunction · 0.90
getArgumentMethod · 0.45
findMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected