MCPcopy Create free account
hub / github.com/code-pushup/cli / promptSetupMode

Function promptSetupMode

packages/create-cli/src/lib/setup/monorepo.ts:27–44  ·  view source on GitHub ↗
(
  targetDir: string,
  cliArgs: CliArgs,
)

Source from the content-addressed store, hash-verified

25const TASK_NAME = 'code-pushup';
26
27export async function promptSetupMode(
28 targetDir: string,
29 cliArgs: CliArgs,
30): Promise<ConfigContext> {
31 switch (cliArgs.mode) {
32 case 'standalone':
33 return toContext(cliArgs.mode, null);
34 case 'monorepo': {
35 const tool = await detectMonorepoTool(targetDir);
36 return toContext(cliArgs.mode, tool);
37 }
38 case undefined: {
39 const tool = await detectMonorepoTool(targetDir);
40 const mode = cliArgs.yes ? inferMode(tool) : await promptMode(tool);
41 return toContext(mode, tool);
42 }
43 }
44}
45
46async function promptMode(tool: MonorepoTool | null): Promise<SetupMode> {
47 return select<SetupMode>({

Callers 2

runSetupWizardFunction · 0.85

Calls 4

detectMonorepoToolFunction · 0.90
toContextFunction · 0.85
inferModeFunction · 0.85
promptModeFunction · 0.85

Tested by

no test coverage detected