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

Function tryDetectServices

packages/cli/src/util/projects/detect-services.ts:66–89  ·  view source on GitHub ↗
(
  cwd: string
)

Source from the content-addressed store, hash-verified

64 * Returns null otherwise.
65 */
66export async function tryDetectServices(
67 cwd: string
68): Promise<DetectServicesResult | null> {
69 const isServicesEnabled = await isExperimentalServicesEnabled(cwd);
70 if (!isServicesEnabled) {
71 return null;
72 }
73
74 const fs = new LocalFileSystemDetector(cwd);
75 const result = await detectServices({
76 fs,
77 detectEntrypoint: createDetectEntrypoint(cwd),
78 });
79
80 // No services configured
81 const hasNoServicesError = result.errors.some(
82 e => e.code === 'NO_EXPERIMENTAL_SERVICES_CONFIGURED'
83 );
84 if (hasNoServicesError) {
85 return null;
86 }
87
88 return result;
89}
90
91export async function writeServicesConfig(
92 cwd: string,

Callers 3

devFunction · 0.90
resolveProjectCwdFunction · 0.90

Calls 3

detectServicesFunction · 0.90
createDetectEntrypointFunction · 0.90

Tested by

no test coverage detected