MCPcopy Create free account
hub / github.com/vercel/vercel / getServicesSetupState

Function getServicesSetupState

packages/cli/src/util/link/services-setup.ts:41–66  ·  view source on GitHub ↗
(
  workPath: string
)

Source from the content-addressed store, hash-verified

39}
40
41export async function getServicesSetupState(
42 workPath: string
43): Promise<ServicesSetupState> {
44 const detectServicesResult = await detectServices({
45 fs: new LocalFileSystemDetector(workPath),
46 detectEntrypoint: createDetectEntrypoint(workPath),
47 });
48 // `resolved` is undefined when no services are detected at all (common for
49 // empty or simple fixtures). Defensive optional chain avoids crashing the
50 // setup flow before any prompts can fire.
51 const hasConfiguredServices =
52 detectServicesResult.resolved?.source === 'configured';
53 const inferredServices = hasConfiguredServices
54 ? null
55 : detectServicesResult.inferred;
56 const inferredServicesWriteBlocker = inferredServices
57 ? await getServicesConfigWriteBlocker(workPath, inferredServices.config)
58 : null;
59
60 return {
61 detectServicesResult,
62 hasConfiguredServices,
63 inferredServices,
64 inferredServicesWriteBlocker,
65 };
66}
67
68export function displayConfiguredServicesSetup(
69 detectServicesResult: DetectServicesResult,

Callers 1

setupAndLinkFunction · 0.90

Calls 3

detectServicesFunction · 0.90
createDetectEntrypointFunction · 0.90

Tested by

no test coverage detected