Skip to content

Commit

Permalink
fix(devtools): overwrite homePath if snap detected (#1614)
Browse files Browse the repository at this point in the history
  • Loading branch information
rxri authored Apr 24, 2022
1 parent e352d67 commit 427e9c6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cmd/devtools.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@ func SetDevTools() {
{
homePath := os.Getenv("HOME")
snapSpotifyHome := homePath + "/snap/spotify/common"
if _, err := os.Stat(snapSpotifyHome); os.IsNotExist(err) {
filePath = homePath + "/.config/spotify/offline.bnk"
if _, err := os.Stat(snapSpotifyHome); os.IsExist(err) {
homePath = snapSpotifyHome
}

filePath = homePath + "/.config/spotify/offline.bnk"
}
case "darwin":
filePath = os.Getenv("HOME") + "/Library/Application Support/Spotify/PersistentCache/offline.bnk"
}

if _, err := os.Stat(filePath); os.IsNotExist(err) {
log.Fatal("Can't find the offline.bnk file!")
}

file, err := os.OpenFile(filePath, os.O_RDWR, 0644)

if err != nil {
Expand Down

0 comments on commit 427e9c6

Please sign in to comment.