MCPcopy Create free account
hub / github.com/deepnote/deepnote / getInstallStatus

Function getInstallStatus

packages/cli/src/commands/install-skills.ts:330–350  ·  view source on GitHub ↗
(targetDir: string, skillContents: Map<string, string>)

Source from the content-addressed store, hash-verified

328}
329
330async function getInstallStatus(targetDir: string, skillContents: Map<string, string>): Promise<InstallStatus> {
331 try {
332 await fs.access(targetDir)
333 } catch {
334 return 'installed'
335 }
336
337 for (const [file, content] of skillContents) {
338 const targetPath = path.join(targetDir, file)
339 try {
340 const existing = await fs.readFile(targetPath, 'utf8')
341 if (existing !== content) {
342 return 'updated'
343 }
344 } catch {
345 return 'installed'
346 }
347 }
348
349 return 'up-to-date'
350}
351
352async function installSkillFiles(targetDir: string, skillContents: Map<string, string>): Promise<InstallStatus> {
353 const status = await getInstallStatus(targetDir, skillContents)

Callers 2

installSkillsFunction · 0.85
installSkillFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected