(cwd: string)
| 62 | * Throws an error if *both* `.vercel` and `.now` directories exist. |
| 63 | */ |
| 64 | export 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 | |
| 78 | export async function getProjectLink( |
| 79 | client: Client, |
no test coverage detected