()
| 98 | } |
| 99 | |
| 100 | export async function clearCachedGoogleAccount(): Promise<void> { |
| 101 | const filePath = getGoogleAccountsCachePath(); |
| 102 | if (!existsSync(filePath)) { |
| 103 | return; |
| 104 | } |
| 105 | |
| 106 | const accounts = await readAccounts(filePath); |
| 107 | |
| 108 | if (accounts.active) { |
| 109 | if (!accounts.old.includes(accounts.active)) { |
| 110 | accounts.old.push(accounts.active); |
| 111 | } |
| 112 | accounts.active = null; |
| 113 | } |
| 114 | |
| 115 | await fsp.writeFile(filePath, JSON.stringify(accounts, null, 2), 'utf-8'); |
| 116 | } |
no test coverage detected