MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / getCliInstallStatus

Function getCliInstallStatus

apps/desktop/src/main/cli-install.ts:275–308  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

273/* ---------- Status read ----------------------------------------------- */
274
275export async function getCliInstallStatus(): Promise<CliInstallStatus> {
276 const supportedPlatform = process.platform === 'darwin' || process.platform === 'linux'
277 if (!supportedPlatform) {
278 return {
279 available: false,
280 reason: 'CLI install is currently macOS- and Linux-only. Windows support is on the way.',
281 defaultTarget: '',
282 requiresSudo: false,
283 targetOnPath: false,
284 pathHint: null,
285 installedAt: null,
286 installedByThisApp: false,
287 supportedPlatform: false
288 }
289 }
290
291 const wrapper = await locateWrapper()
292 const target = await pickInstallTarget()
293 const existing = await findExistingInstall(wrapper)
294
295 return {
296 available: wrapper != null,
297 reason: wrapper
298 ? null
299 : 'The CLI has not been built yet. Run `npm run build` (or use a packaged build) so Settings has a wrapper to install.',
300 defaultTarget: target.linkPath,
301 requiresSudo: target.requiresSudo,
302 targetOnPath: target.onPath,
303 pathHint: target.pathHint,
304 installedAt: existing?.linkPath ?? null,
305 installedByThisApp: existing?.installedByThisApp ?? false,
306 supportedPlatform: true
307 }
308}
309
310/**
311 * Remove ZenNotes-managed symlinks with the given names across candidate dirs —

Callers 4

registerIpcFunction · 0.90
installCliFunction · 0.85
uninstallCliFunction · 0.85
findManagedCliBinaryFunction · 0.85

Calls 3

locateWrapperFunction · 0.85
pickInstallTargetFunction · 0.85
findExistingInstallFunction · 0.85

Tested by

no test coverage detected