(filePath: string, content: string)
| 151 | } |
| 152 | |
| 153 | function writeFileAtomicSync(filePath: string, content: string): void { |
| 154 | const dir = dirname(filePath); |
| 155 | mkdirSync(dir, { recursive: true, mode: 0o700 }); |
| 156 | |
| 157 | const tempPath = join(dir, `.daemon.json.${process.pid}.${randomUUID()}.tmp`); |
| 158 | try { |
| 159 | writeFileSync(tempPath, content, { encoding: 'utf8', mode: 0o600 }); |
| 160 | renameSync(tempPath, filePath); |
| 161 | } catch (error) { |
| 162 | rmSync(tempPath, { force: true }); |
| 163 | throw error; |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | function withDaemonRegistryMutationLock<T>( |
| 168 | workspaceKey: string, |
no outgoing calls
no test coverage detected