()
| 368 | |
| 369 | /** |
| 370 | * Custom AuthStorageBackend that persists OAuth credentials to the `_auth` |
| 371 | * field of config.json, keeping all configuration in a single file. |
| 372 | */ |
| 373 | export class ConfigFileAuthBackend implements AuthStorageBackend { |
| 374 | constructor(private configPath: string) {} |
| 375 | |
| 376 | private ensureFile(): void { |
| 377 | const dir = path.dirname(this.configPath); |
| 378 | if (!fs.existsSync(dir)) { |
| 379 | fs.mkdirSync(dir, { recursive: true }); |
| 380 | } |
| 381 | if (!fs.existsSync(this.configPath)) { |
no outgoing calls
no test coverage detected