MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / forceRemoveLock

Function forceRemoveLock

src/utils/nativeInstaller/installer.ts:1168–1179  ·  view source on GitHub ↗

* Force-remove a lock file for a given version path. * Used when --force is specified to bypass stale locks.

(versionFilePath: string)

Source from the content-addressed store, hash-verified

1166 * Used when --force is specified to bypass stale locks.
1167 */
1168async function forceRemoveLock(versionFilePath: string): Promise<void> {
1169 const dirs = getBaseDirectories()
1170 const lockfilePath = getLockFilePathFromVersionPath(dirs, versionFilePath)
1171
1172 try {
1173 await unlink(lockfilePath)
1174 logForDebugging(`Force-removed lock file at ${lockfilePath}`)
1175 } catch (error) {
1176 // Log but don't throw - we'll try to acquire the lock anyway
1177 logForDebugging(`Failed to force-remove lock file: ${errorMessage(error)}`)
1178 }
1179}
1180
1181export async function cleanupOldVersions(): Promise<void> {
1182 // Yield to ensure we don't block startup

Callers 1

updateLatestFunction · 0.85

Calls 5

getBaseDirectoriesFunction · 0.85
unlinkFunction · 0.85
logForDebuggingFunction · 0.50
errorMessageFunction · 0.50

Tested by

no test coverage detected