Skip to content

Commit

Permalink
Reverted commit
Browse files Browse the repository at this point in the history
  • Loading branch information
UnaTried committed Feb 2, 2025
1 parent d12ff99 commit ccc208a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/utils/path-utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,28 @@ func GetSpicetifyFolder() string {
func GetStateFolder(name string) string {
result, isAvailable := os.LookupEnv("SPICETIFY_STATE")
defer func() { CheckExistAndCreate(result) }()

if isAvailable && len(result) > 0 {
return result
}

if runtime.GOOS == "linux" {
if runtime.GOOS == "windows" {
parent := os.Getenv("APPDATA")

result = filepath.Join(parent, "spicetify")
} else if runtime.GOOS == "linux" {
parent, isAvailable := os.LookupEnv("XDG_STATE_HOME")

if !isAvailable || len(parent) == 0 {
parent = filepath.Join(os.Getenv("HOME"), ".local", "state")
CheckExistAndCreate(parent)
}

result = filepath.Join(parent, "spicetify")
} else if runtime.GOOS == "darwin" {
parent := filepath.Join(os.Getenv("HOME"), ".local", "state")
CheckExistAndCreate(parent)

result = filepath.Join(parent, "spicetify")
}
return result
Expand Down

0 comments on commit ccc208a

Please sign in to comment.