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