| 160 | var userExtensionsFolder = GetSubFolder(GetSpicetifyFolder(), "Extensions") |
| 161 | |
| 162 | func 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 | |
| 186 | func GetCustomAppPath(name string) (string, error) { |
| 187 | customAppFolderPath := filepath.Join(userAppsFolder, name) |