(path: string, file: CredentialsFile)
| 138 | } |
| 139 | |
| 140 | function writeCredentialsAtomic(path: string, file: CredentialsFile): void { |
| 141 | mkdirSync(dirname(path), { recursive: true, mode: 0o700 }); |
| 142 | const tmp = `${path}.tmp.${process.pid}`; |
| 143 | writeFileSync(tmp, serializeCredentials(file), { mode: 0o600, encoding: 'utf8' }); |
| 144 | renameSync(tmp, path); |
| 145 | ensureRestrictiveMode(path); |
| 146 | } |
no test coverage detected