MCPcopy Create free account
hub / github.com/cli/cli / readSkillFile

Function readSkillFile

pkg/cmd/skills/list/list.go:369–378  ·  view source on GitHub ↗

readSkillFile reads a SKILL.md file only if it resolves to a regular file.

(path string)

Source from the content-addressed store, hash-verified

367
368// readSkillFile reads a SKILL.md file only if it resolves to a regular file.
369func readSkillFile(path string) ([]byte, error) {
370 info, err := os.Stat(path)
371 if err != nil {
372 return nil, err
373 }
374 if !info.Mode().IsRegular() {
375 return nil, fmt.Errorf("SKILL.md is not a regular file: %s", path)
376 }
377 return os.ReadFile(path)
378}
379
380func shouldIncludeSkill(filter scanFilter, hasInstallMetadata bool) bool {
381 switch filter {

Callers 1

scanInstalledSkillsFunction · 0.85

Calls 2

ModeMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected