(credentials: Credentials)
| 381 | } |
| 382 | |
| 383 | async function cacheCredentials(credentials: Credentials) { |
| 384 | const filePath = getCachedCredentialPath(); |
| 385 | await fs.mkdir(path.dirname(filePath), { recursive: true }); |
| 386 | |
| 387 | const credString = JSON.stringify(credentials, null, 2); |
| 388 | await fs.writeFile(filePath, credString, { mode: 0o600 }); |
| 389 | } |
| 390 | |
| 391 | function getCachedCredentialPath(): string { |
| 392 | return path.join(os.homedir(), ANUS_DIR, CREDENTIAL_FILENAME); |
no test coverage detected