* Remove claude aliases from shell configuration files * This helps clean up old installation methods when switching to native or npm global
()
| 537 | * This helps clean up old installation methods when switching to native or npm global |
| 538 | */ |
| 539 | async function removeClaudeAliasesFromShellConfigs(): Promise<void> { |
| 540 | const configMap = getShellConfigPaths() |
| 541 | |
| 542 | // Process each shell config file |
| 543 | for (const [, configFile] of Object.entries(configMap)) { |
| 544 | try { |
| 545 | const lines = await readFileLines(configFile) |
| 546 | if (!lines) continue |
| 547 | |
| 548 | const { filtered, hadAlias } = filterClaudeAliases(lines) |
| 549 | |
| 550 | if (hadAlias) { |
| 551 | await writeFileLines(configFile, filtered) |
| 552 | logForDebugging(`Removed claude alias from ${configFile}`) |
| 553 | } |
| 554 | } catch (error) { |
| 555 | // Don't fail the whole operation if one file can't be processed |
| 556 | logForDebugging(`Failed to remove alias from ${configFile}: ${error}`, { |
| 557 | level: 'error', |
| 558 | }) |
| 559 | } |
| 560 | } |
| 561 | } |
| 562 |
no test coverage detected