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

Function getVercelDirectory

packages/cli/src/util/projects/link.ts:64–76  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

62 * Throws an error if *both* `.vercel` and `.now` directories exist.
63 */
64export function getVercelDirectory(cwd: string): string {
65 const possibleDirs = [join(cwd, VERCEL_DIR), join(cwd, VERCEL_DIR_FALLBACK)];
66 const existingDirs = possibleDirs.filter(d => isDirectory(d));
67 if (existingDirs.length > 1) {
68 throw new NowBuildError({
69 code: 'CONFLICTING_CONFIG_DIRECTORIES',
70 message:
71 'Both `.vercel` and `.now` directories exist. Please remove the `.now` directory.',
72 link: 'https://vercel.link/combining-old-and-new-config',
73 });
74 }
75 return existingDirs[0] || possibleDirs[0];
76}
77
78export async function getProjectLink(
79 client: Client,

Callers 9

saveTelemetryFunction · 0.90
listStoresFunction · 0.90
warnIfStaleLinkExistsFunction · 0.90
getScopeFunction · 0.90
setupAndLinkFunction · 0.90
constructorMethod · 0.90
getProjectLinkFunction · 0.85
hasProjectLinkFunction · 0.85

Calls 2

isDirectoryFunction · 0.90
filterMethod · 0.80

Tested by

no test coverage detected