()
| 1463 | * Will only remove if it's a native binary symlink, not npm-managed JS files |
| 1464 | */ |
| 1465 | export async function removeInstalledSymlink(): Promise<void> { |
| 1466 | const dirs = getBaseDirectories() |
| 1467 | |
| 1468 | try { |
| 1469 | // Check if this is an npm-managed installation |
| 1470 | if (await isNpmSymlink(dirs.executable)) { |
| 1471 | logForDebugging( |
| 1472 | `Skipping removal of ${dirs.executable} - appears to be npm-managed`, |
| 1473 | ) |
| 1474 | return |
| 1475 | } |
| 1476 | |
| 1477 | // It's a native binary symlink, safe to remove |
| 1478 | await unlink(dirs.executable) |
| 1479 | logForDebugging(`Removed claude symlink at ${dirs.executable}`) |
| 1480 | } catch (error) { |
| 1481 | if (isENOENT(error)) { |
| 1482 | return |
| 1483 | } |
| 1484 | logError(new Error(`Failed to remove claude symlink: ${error}`)) |
| 1485 | } |
| 1486 | } |
| 1487 | |
| 1488 | /** |
| 1489 | * Clean up old claude aliases from shell configuration files |
no test coverage detected