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

Function tryRemove

src/utils/nativeInstaller/installer.ts:1538–1546  ·  view source on GitHub ↗
(filePath: string, description: string)

Source from the content-addressed store, hash-verified

1536 // A stat() pre-check would add a syscall and a TOCTOU window where
1537 // concurrent cleanup causes a false-negative return.
1538 async function tryRemove(filePath: string, description: string) {
1539 try {
1540 await unlink(filePath)
1541 logForDebugging(`Manually removed ${description}: ${filePath}`)
1542 return true
1543 } catch {
1544 return false
1545 }
1546 }
1547
1548 if (getPlatform().startsWith('win32')) {
1549 // Windows - only remove executables, not the package directory.

Callers 1

manualRemoveNpmPackageFunction · 0.85

Calls 2

unlinkFunction · 0.85
logForDebuggingFunction · 0.50

Tested by

no test coverage detected