MCPcopy Index your code
hub / github.com/codeaashu/claude-code / tryRemove

Function tryRemove

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

Source from the content-addressed store, hash-verified

1547 // A stat() pre-check would add a syscall and a TOCTOU window where
1548 // concurrent cleanup causes a false-negative return.
1549 async function tryRemove(filePath: string, description: string) {
1550 try {
1551 await unlink(filePath)
1552 logForDebugging(`Manually removed ${description}: ${filePath}`)
1553 return true
1554 } catch {
1555 return false
1556 }
1557 }
1558
1559 if (getPlatform().startsWith('win32')) {
1560 // 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