MCPcopy
hub / github.com/codeaashu/claude-code / releaseLock

Function releaseLock

src/utils/autoUpdater.ts:254–268  ·  view source on GitHub ↗

* Releases the update lock if it's held by this process

()

Source from the content-addressed store, hash-verified

252 * Releases the update lock if it's held by this process
253 */
254async function releaseLock(): Promise<void> {
255 const fs = getFsImplementation()
256 const lockPath = getLockFilePath()
257 try {
258 const lockData = await fs.readFile(lockPath, { encoding: 'utf8' })
259 if (lockData === `${process.pid}`) {
260 await fs.unlink(lockPath)
261 }
262 } catch (err) {
263 if (isENOENT(err)) {
264 return
265 }
266 logError(err as Error)
267 }
268}
269
270async function getInstallationPrefix(): Promise<string | null> {
271 // Run from home directory to avoid reading project-level .npmrc/.bunfig.toml

Callers 4

installGlobalPackageFunction · 0.85
withStatsCacheLockFunction · 0.85

Calls 5

getFsImplementationFunction · 0.85
getLockFilePathFunction · 0.85
isENOENTFunction · 0.85
readFileMethod · 0.80
logErrorFunction · 0.70

Tested by

no test coverage detected