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

Function createPlatformPrompter

src/cli/commands/__tests__/setup.test.ts:111–129  ·  view source on GitHub ↗
(platforms: string[])

Source from the content-addressed store, hash-verified

109}
110
111function createPlatformPrompter(platforms: string[]): Prompter {
112 let selectManyCalls = 0;
113 return {
114 selectOne: async <T>(opts: { options: Array<{ value: T }> }) => {
115 const preferredOption = opts.options.find((option) => option.value != null);
116 return (preferredOption ?? opts.options[0]).value;
117 },
118 selectMany: async <T>(opts: { options: Array<{ value: T }> }) => {
119 selectManyCalls++;
120 if (selectManyCalls === 1) {
121 return opts.options
122 .filter((option) => platforms.includes(String(option.value)))
123 .map((option) => option.value);
124 }
125 return opts.options.map((option) => option.value);
126 },
127 confirm: async (opts: { defaultValue: boolean }) => opts.defaultValue,
128 };
129}
130
131describe('setup command', () => {
132 const originalStdinIsTTY = process.stdin.isTTY;

Callers 1

setup.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected