()
| 126 | } |
| 127 | |
| 128 | export function getGlobalPathConfig(): string { |
| 129 | const vercelDirectories = XDGAppPaths('com.vercel.cli').dataDirs(); |
| 130 | |
| 131 | const possibleConfigPaths = [ |
| 132 | ...vercelDirectories, // latest vercel directory |
| 133 | path.join(homedir(), '.now'), // legacy config in user's home directory |
| 134 | ...XDGAppPaths('now').dataDirs(), // legacy XDG directory |
| 135 | ]; |
| 136 | |
| 137 | return ( |
| 138 | possibleConfigPaths.find(configPath => isReadableDirectory(configPath)) || |
| 139 | vercelDirectories[0] |
| 140 | ); |
| 141 | } |
| 142 | |
| 143 | export function getConfigFilePath(configDir: string): string { |
| 144 | return path.join(configDir, 'config.json'); |
no test coverage detected