(projectDir?: string | null)
| 66 | * @param projectDir the Firebase project directory. |
| 67 | */ |
| 68 | export function getProjectDefaultAccount(projectDir?: string | null): Account | undefined { |
| 69 | if (!projectDir) { |
| 70 | return getGlobalDefaultAccount(); |
| 71 | } |
| 72 | |
| 73 | const activeAccounts = configstore.get("activeAccounts") || {}; |
| 74 | const email: string | undefined = activeAccounts[projectDir]; |
| 75 | |
| 76 | if (!email) { |
| 77 | return getGlobalDefaultAccount(); |
| 78 | } |
| 79 | |
| 80 | const allAccounts = getAllAccounts(); |
| 81 | return allAccounts.find((a) => a.user.email === email); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Get all authenticated accounts _besides_ the default account. |
no test coverage detected
searching dependent graphs…