MCPcopy
hub / github.com/spicetify/cli / WinXPrefs

Function WinXPrefs

src/utils/config.go:247–269  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245}
246
247func 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
271func linuxApp() string {
272 path, err := exec.Command("whereis", "-b", "spotify").Output()

Callers 2

EnableDevToolsFunction · 0.92
FindPrefFilePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected