()
| 245 | } |
| 246 | |
| 247 | func WinXPrefs() string { |
| 248 | ps, _ := exec.LookPath("powershell.exe") |
| 249 | cmd := exec.Command(ps, |
| 250 | "-NoProfile", |
| 251 | "-NonInteractive", |
| 252 | `(Get-AppxPackage | Where-Object -Property Name -Match "^SpotifyAB").PackageFamilyName`) |
| 253 | |
| 254 | stdOut, err := cmd.CombinedOutput() |
| 255 | if err == nil { |
| 256 | path := filepath.Join( |
| 257 | os.Getenv("LOCALAPPDATA"), |
| 258 | "Packages", |
| 259 | strings.TrimSpace(string(stdOut)), |
| 260 | "LocalState", |
| 261 | "Spotify", |
| 262 | "prefs") |
| 263 | if _, err := os.Stat(path); err == nil { |
| 264 | return path |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | return "" |
| 269 | } |
| 270 | |
| 271 | func linuxApp() string { |
| 272 | path, err := exec.Command("whereis", "-b", "spotify").Output() |
no outgoing calls
no test coverage detected