MCPcopy
hub / github.com/rpamis/comet / selectPlatforms

Function selectPlatforms

src/commands/init.ts:93–110  ·  view source on GitHub ↗
(
  detected: Set<string>,
  options: InitOptions,
  lang: string,
)

Source from the content-addressed store, hash-verified

91}
92
93async function selectPlatforms(
94 detected: Set<string>,
95 options: InitOptions,
96 lang: string,
97): Promise<string[]> {
98 const choices = PLATFORMS.map((p) => ({
99 name: `${p.name}${detected.has(p.id) ? ` (${t(lang, 'detected')})` : ''}`,
100 value: p.id,
101 checked: detected.has(p.id),
102 }));
103
104 if (options.yes) {
105 const selected = [...detected];
106 return selected.length > 0 ? selected : PLATFORMS.map((p) => p.id);
107 }
108
109 return checkbox({ message: t(lang, 'selectPlatforms'), choices, required: true });
110}
111
112async function promptOverwriteChoice(
113 componentName: string,

Callers 1

initCommandFunction · 0.85

Calls 1

tFunction · 0.85

Tested by

no test coverage detected