MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / selectScheme

Function selectScheme

src/cli/commands/setup.ts:497–534  ·  view source on GitHub ↗
(opts: {
  projectChoice: ProjectChoice;
  existingScheme?: string;
  executor: CommandExecutor;
  prompter: Prompter;
  isTTY: boolean;
  quietOutput: boolean;
})

Source from the content-addressed store, hash-verified

495}
496
497async function selectScheme(opts: {
498 projectChoice: ProjectChoice;
499 existingScheme?: string;
500 executor: CommandExecutor;
501 prompter: Prompter;
502 isTTY: boolean;
503 quietOutput: boolean;
504}): Promise<string> {
505 const schemeArgs =
506 opts.projectChoice.kind === 'workspace'
507 ? { workspacePath: opts.projectChoice.absolutePath }
508 : { projectPath: opts.projectChoice.absolutePath };
509
510 const schemes = await withSpinner({
511 isTTY: opts.isTTY,
512 quietOutput: opts.quietOutput,
513 startMessage: 'Loading schemes...',
514 stopMessage: 'Schemes loaded.',
515 task: () => listSchemes(schemeArgs, opts.executor),
516 });
517
518 if (schemes.length === 0) {
519 throw new Error('No schemes were found for the selected project/workspace.');
520 }
521
522 const defaultIndex =
523 opts.existingScheme != null ? schemes.findIndex((scheme) => scheme === opts.existingScheme) : 0;
524
525 showPromptHelp(
526 'Select a scheme to set the default used when you do not pass --scheme.',
527 opts.quietOutput,
528 );
529 return opts.prompter.selectOne({
530 message: 'Select a scheme',
531 options: schemes.map((scheme) => ({ value: scheme, label: scheme })),
532 initialIndex: defaultIndex >= 0 ? defaultIndex : 0,
533 });
534}
535
536function getDefaultSimulatorIndex(
537 simulators: ListedSimulator[],

Callers 1

collectSetupSelectionFunction · 0.85

Calls 4

listSchemesFunction · 0.90
withSpinnerFunction · 0.85
showPromptHelpFunction · 0.85
selectOneMethod · 0.80

Tested by

no test coverage detected