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

Function withSpinner

src/cli/commands/setup.ts:112–133  ·  view source on GitHub ↗
(opts: {
  isTTY: boolean;
  quietOutput: boolean;
  startMessage: string;
  stopMessage: string;
  task: () => Promise<T>;
})

Source from the content-addressed store, hash-verified

110}
111
112async function withSpinner<T>(opts: {
113 isTTY: boolean;
114 quietOutput: boolean;
115 startMessage: string;
116 stopMessage: string;
117 task: () => Promise<T>;
118}): Promise<T> {
119 if (!opts.isTTY || opts.quietOutput) {
120 return opts.task();
121 }
122
123 const s = clack.spinner();
124 s.start(opts.startMessage);
125 try {
126 const result = await opts.task();
127 s.stop(opts.stopMessage);
128 return result;
129 } catch (error) {
130 s.stop(opts.startMessage);
131 throw error;
132 }
133}
134
135function valuesEqual(left: unknown, right: unknown): boolean {
136 return JSON.stringify(left) === JSON.stringify(right);

Callers 5

selectProjectChoiceFunction · 0.85
selectSchemeFunction · 0.85
selectSimulatorFunction · 0.85
selectDeviceFunction · 0.85
ensureSetupPrerequisitesFunction · 0.85

Calls 2

startMethod · 0.65
stopMethod · 0.65

Tested by

no test coverage detected