FindAppPath finds Spotify location in various possible places of each platform and returns it. Returns blank string if none of default locations exists.
()
| 168 | // of each platform and returns it. |
| 169 | // Returns blank string if none of default locations exists. |
| 170 | func FindAppPath() string { |
| 171 | switch runtime.GOOS { |
| 172 | case "windows": |
| 173 | path := winApp() |
| 174 | if len(path) == 0 { |
| 175 | path = WinXApp() |
| 176 | } |
| 177 | return path |
| 178 | |
| 179 | case "linux": |
| 180 | return linuxApp() |
| 181 | |
| 182 | case "darwin": |
| 183 | return darwinApp() |
| 184 | } |
| 185 | |
| 186 | return "" |
| 187 | } |
| 188 | |
| 189 | // FindPrefFilePath finds Spotify "prefs" file location |
| 190 | // in various possible places of each platform and returns it. |