( filePath: string, lines: string[], )
| 94 | * Write lines back to a file |
| 95 | */ |
| 96 | export async function writeFileLines( |
| 97 | filePath: string, |
| 98 | lines: string[], |
| 99 | ): Promise<void> { |
| 100 | const fh = await open(filePath, 'w') |
| 101 | try { |
| 102 | await fh.writeFile(lines.join('\n'), { encoding: 'utf8' }) |
| 103 | await fh.datasync() |
| 104 | } finally { |
| 105 | await fh.close() |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * Check if a claude alias exists in any shell config file |
no test coverage detected