MCPcopy Create free account
hub / github.com/compozy/agh / locateExtractedSkillFile

Function locateExtractedSkillFile

internal/cli/skill_marketplace.go:446–472  ·  view source on GitHub ↗
(root string)

Source from the content-addressed store, hash-verified

444}
445
446func locateExtractedSkillFile(root string) (string, error) {
447 var matches []string
448
449 err := filepath.WalkDir(root, func(current string, entry fs.DirEntry, walkErr error) error {
450 if walkErr != nil {
451 return walkErr
452 }
453 if entry.IsDir() {
454 return nil
455 }
456 if entry.Name() != skillMarkdownFileName {
457 return nil
458 }
459 matches = append(matches, current)
460 if len(matches) > 1 {
461 return errors.New("multiple SKILL.md files found in archive")
462 }
463 return nil
464 })
465 if err != nil {
466 return "", err
467 }
468 if len(matches) == 0 {
469 return "", errors.New("archive did not contain SKILL.md")
470 }
471 return matches[0], nil
472}
473
474func moveInstalledSkillDir(extractedDir string, targetDir string, replaceExisting bool) error {
475 return registrypkg.MoveInstalledDir(extractedDir, targetDir, replaceExisting)

Callers 1

Calls 2

appendFunction · 0.85
NameMethod · 0.65

Tested by 1