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

Function getVersionPaths

src/utils/nativeInstaller/installer.ts:153–177  ·  view source on GitHub ↗
(version: string)

Source from the content-addressed store, hash-verified

151}
152
153async function getVersionPaths(version: string) {
154 const dirs = getBaseDirectories()
155
156 // Create directories, but not the executable path (which is a file)
157 const dirsToCreate = [dirs.versions, dirs.staging, dirs.locks]
158 await Promise.all(dirsToCreate.map(dir => mkdir(dir, { recursive: true })))
159
160 // Ensure parent directory of executable exists
161 const executableParentDir = dirname(dirs.executable)
162 await mkdir(executableParentDir, { recursive: true })
163
164 const installPath = join(dirs.versions, version)
165
166 // Create an empty file if it doesn't exist
167 try {
168 await stat(installPath)
169 } catch {
170 await writeFile(installPath, '', { encoding: 'utf8' })
171 }
172
173 return {
174 stagingPath: join(dirs.staging, version),
175 installPath,
176 }
177}
178
179// Execute a callback while holding a lock on a version file
180// Returns false if the file is already locked, true if callback executed

Callers 3

performVersionUpdateFunction · 0.85
versionIsAvailableFunction · 0.85
updateLatestFunction · 0.85

Calls 3

getBaseDirectoriesFunction · 0.85
mkdirFunction · 0.85
statFunction · 0.85

Tested by

no test coverage detected