(item: JsonRecord, note: string)
| 328 | throw error; |
| 329 | } |
| 330 | return apiResponse(output, operation); |
| 331 | } |
| 332 | |
| 333 | function projectExists(context: VercelContext): boolean { |
| 334 | try { |
| 335 | vercelApi( |
| 336 | context, |
| 337 | `/v9/projects/${encodeURIComponent(context.project)}`, |
| 338 | `Read ${context.project}` |
| 339 | ); |
| 340 | return true; |
| 341 | } catch (error) { |
| 342 | if (error instanceof VercelApiError && error.code === 'not_found') return false; |
| 343 | throw error; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | export function resolveVercelContexts(tempDirectory: string): VercelContexts { |
| 348 | let whoami: JsonRecord; |
| 349 | try { |
| 350 | whoami = parseJson( |
| 351 | vercel(undefined, ['whoami', '--format=json'], undefined, { includeFailureOutput: true }), |
| 352 | 'Vercel login' |
| 353 | ); |
| 354 | } catch (error) { |
no test coverage detected