MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / tryRemove

Function tryRemove

source code/utils/nativeInstaller/installer.ts:1551–1559  ·  view source on GitHub ↗
(filePath: string, description: string)

Source from the content-addressed store, hash-verified

1549 // A stat() pre-check would add a syscall and a TOCTOU window where
1550 // concurrent cleanup causes a false-negative return.
1551 async function tryRemove(filePath: string, description: string) {
1552 try {
1553 await unlink(filePath)
1554 logForDebugging(`Manually removed ${description}: ${filePath}`)
1555 return true
1556 } catch {
1557 return false
1558 }
1559 }
1560
1561 if (getPlatform().startsWith('win32')) {
1562 // Windows - only remove executables, not the package directory

Callers 1

manualRemoveNpmPackageFunction · 0.85

Calls 2

unlinkFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected