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

Function promptCustomPath

src/cli/commands/init.ts:422–445  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

420}
421
422async function promptCustomPath(): Promise<string> {
423 if (!isInteractiveTTY()) {
424 throw new Error('Cannot prompt for custom path in non-interactive mode. Use --dest instead.');
425 }
426
427 const result = await clack.text({
428 message: 'Enter the destination directory path:',
429 validate: (value: string | undefined) => {
430 if (!value?.trim()) return 'Path cannot be empty.';
431 const resolved = resolvePathFromCwd(value);
432 if (resolved === path.parse(resolved).root) {
433 return 'Refusing to use filesystem root. Use a dedicated directory.';
434 }
435 return undefined;
436 },
437 });
438
439 if (clack.isCancel(result)) {
440 clack.cancel('Operation cancelled.');
441 throw new Error('Operation cancelled.');
442 }
443
444 return resolvePathFromCwd(result as string);
445}
446
447export function registerInitCommand(app: Argv, ctx?: { workspaceRoot: string }): void {
448 app.command(

Callers 1

collectInitSelectionFunction · 0.85

Calls 3

isInteractiveTTYFunction · 0.90
resolvePathFromCwdFunction · 0.90
textMethod · 0.80

Tested by

no test coverage detected