MCPcopy Index your code
hub / github.com/code-pushup/cli / resolveBinding

Function resolveBinding

packages/create-cli/src/lib/setup/wizard.ts:89–111  ·  view source on GitHub ↗
(
  binding: PluginSetupBinding,
  cliArgs: CliArgs,
  targetDir: string,
  tree: Pick<Tree, 'read' | 'write'>,
)

Source from the content-addressed store, hash-verified

87}
88
89async function resolveBinding(
90 binding: PluginSetupBinding,
91 cliArgs: CliArgs,
92 targetDir: string,
93 tree: Pick<Tree, 'read' | 'write'>,
94): Promise<PluginCodegenResult> {
95 if (!binding.prompts) {
96 return binding.generateConfig({
97 tree,
98 targetDir,
99 cliArgs,
100 answers: {},
101 });
102 }
103 logger.newline();
104 logger.info(ansis.bold(binding.title));
105 const descriptors = await binding.prompts(targetDir);
106 const answers =
107 descriptors.length > 0
108 ? await promptPluginOptions(descriptors, cliArgs)
109 : {};
110 return binding.generateConfig({ tree, targetDir, cliArgs, answers });
111}
112
113async function writeStandaloneConfig(
114 { tree, format, configFilename }: WriteContext,

Callers 1

runSetupWizardFunction · 0.85

Calls 3

promptPluginOptionsFunction · 0.85
newlineMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected