()
| 220 | } |
| 221 | |
| 222 | export async function getRaycastExtensionStatus(): Promise<RaycastExtensionStatus> { |
| 223 | const supportedPlatform = process.platform === 'darwin' |
| 224 | const extensionPath = raycastExtensionInstallPath() |
| 225 | const bundledVersion = app.getVersion() |
| 226 | const [sourcePath, raycastInstalled, toolchain, marker, installed] = await Promise.all([ |
| 227 | locateBundledRaycastSource(), |
| 228 | raycastAppInstalled(), |
| 229 | resolveToolchain(), |
| 230 | readInstallMarker(extensionPath), |
| 231 | localExtensionExists(extensionPath) |
| 232 | ]) |
| 233 | const reason = unavailableReason({ |
| 234 | supportedPlatform, |
| 235 | sourcePath, |
| 236 | raycastInstalled, |
| 237 | toolchain |
| 238 | }) |
| 239 | |
| 240 | return { |
| 241 | available: reason == null, |
| 242 | reason, |
| 243 | supportedPlatform, |
| 244 | installed, |
| 245 | upToDate: installed && marker.version === bundledVersion, |
| 246 | extensionPath, |
| 247 | sourcePath, |
| 248 | raycastInstalled, |
| 249 | nodeAvailable: toolchain.nodePath != null, |
| 250 | npmAvailable: toolchain.npmPath != null, |
| 251 | nodePath: toolchain.nodePath, |
| 252 | npmPath: toolchain.npmPath, |
| 253 | nodeVersion: toolchain.nodeVersion, |
| 254 | npmVersion: toolchain.npmVersion, |
| 255 | nodeMeetsMinimum: toolchain.nodeMeetsMinimum, |
| 256 | npmMeetsMinimum: toolchain.npmMeetsMinimum, |
| 257 | installedVersion: installed ? marker.version : null, |
| 258 | bundledVersion, |
| 259 | lastInstalledAt: installed ? marker.installedAt : null |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | export async function installRaycastExtension(): Promise<RaycastExtensionStatus> { |
| 264 | const status = await getRaycastExtensionStatus() |
no test coverage detected