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

Function forceRemoveLock

src/utils/nativeInstaller/installer.ts:1171–1182  ·  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

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

Callers 1

updateLatestFunction · 0.85

Calls 5

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

Tested by

no test coverage detected