MCPcopy Create free account
hub / github.com/Noumena-Network/code / removeInstalledSymlink

Function removeInstalledSymlink

src/utils/nativeInstaller/installer.ts:1454–1475  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1452 * Will only remove if it's a native binary symlink, not npm-managed JS files
1453 */
1454export 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

Callers 2

AutoUpdaterFunction · 0.85
updateFunction · 0.85

Calls 6

getBaseDirectoriesFunction · 0.85
isNpmSymlinkFunction · 0.85
unlinkFunction · 0.85
isENOENTFunction · 0.85
logForDebuggingFunction · 0.50
logErrorFunction · 0.50

Tested by

no test coverage detected