MCPcopy Index your code
hub / github.com/spicetify/cli / GetCustomAppSubfolderPath

Function GetCustomAppSubfolderPath

src/utils/path-utils.go:162–184  ·  view source on GitHub ↗
(folderPath string)

Source from the content-addressed store, hash-verified

160var userExtensionsFolder = GetSubFolder(GetSpicetifyFolder(), "Extensions")
161
162func GetCustomAppSubfolderPath(folderPath string) string {
163 entries, err := os.ReadDir(folderPath)
164 if err != nil {
165 return ""
166 }
167
168 for _, entry := range entries {
169 if entry.IsDir() {
170 subfolderPath := filepath.Join(folderPath, entry.Name())
171 indexPath := filepath.Join(subfolderPath, "index.js")
172
173 if _, err := os.Stat(indexPath); err == nil {
174 return subfolderPath
175 }
176
177 if subfolderPath := GetCustomAppSubfolderPath(subfolderPath); subfolderPath != "" {
178 return subfolderPath
179 }
180 }
181 }
182
183 return ""
184}
185
186func GetCustomAppPath(name string) (string, error) {
187 customAppFolderPath := filepath.Join(userAppsFolder, name)

Callers 1

GetCustomAppPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected