MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / uniqueExistingOrder

Function uniqueExistingOrder

skills/loader.go:127–148  ·  view source on GitHub ↗
(paths []string)

Source from the content-addressed store, hash-verified

125func expandSkillHome(path string) string {
126 if path == "~" {
127 if home := skillHomeDir(); home != "" {
128 return home
129 }
130 }
131 if strings.HasPrefix(path, "~/") {
132 if home := skillHomeDir(); home != "" {
133 return filepath.Join(home, path[2:])
134 }
135 }
136 return path
137}
138
139func skillHomeDir() string {
140 if home := strings.TrimSpace(os.Getenv("HOME")); home != "" {
141 return home
142 }
143 home, _ := os.UserHomeDir()
144 return home
145}
146
147func uniqueExistingOrder(paths []string) []string {
148 seen := map[string]struct{}{}
149 out := make([]string, 0, len(paths))
150 for _, path := range paths {
151 if path == "" {

Callers 1

ProjectSkillsDirsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected