MCPcopy Create free account
hub / github.com/codeaashu/claude-code / isPossibleClaudeBinary

Function isPossibleClaudeBinary

src/utils/nativeInstaller/installer.ts:134–151  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

132}
133
134async function isPossibleClaudeBinary(filePath: string): Promise<boolean> {
135 try {
136 const stats = await stat(filePath)
137 // before download, the version lock file (located at the same filePath) will be size 0
138 // also, we allow small sizes because we want to treat small wrapper scripts as valid
139 if (!stats.isFile() || stats.size === 0) {
140 return false
141 }
142
143 // Check if file is executable. Note: On Windows, this relies on file extensions
144 // (.exe, .bat, .cmd) and ACL permissions rather than Unix permission bits,
145 // so it may not work perfectly for all executable files on Windows.
146 await access(filePath, fsConstants.X_OK)
147 return true
148 } catch {
149 return false
150 }
151}
152
153async function getVersionPaths(version: string) {
154 const dirs = getBaseDirectories()

Callers 5

performVersionUpdateFunction · 0.85
versionIsAvailableFunction · 0.85
updateLatestFunction · 0.85
checkInstallFunction · 0.85
getVersionFromSymlinkFunction · 0.85

Calls 1

statFunction · 0.85

Tested by

no test coverage detected