(filePath: string)
| 132 | } |
| 133 | |
| 134 | async 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 | |
| 153 | async function getVersionPaths(version: string) { |
| 154 | const dirs = getBaseDirectories() |
no test coverage detected