From 190393f144c8ec8846b022c890243e8662d824c7 Mon Sep 17 00:00:00 2001 From: ririxi Date: Fri, 2 Aug 2024 22:11:09 +0200 Subject: [PATCH 1/6] feat(update): run `backup apply` for stock spotify The reason for this change is that people assume spicetify has an update when spotify is in stock. This change was voted positively in spicetify server. --- spicetify.go | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/spicetify.go b/spicetify.go index b59dd7d4ea..d1be9e479d 100644 --- a/spicetify.go +++ b/spicetify.go @@ -232,14 +232,14 @@ func main() { utils.PrintBold("spicetify v" + version) if slices.Contains(commands, "upgrade") || slices.Contains(commands, "update") { updateStatus := cmd.Update(version) - if updateStatus { - ex, err := os.Executable() - if err != nil { - ex = "spicetify" - } + spotifyPath := filepath.Join(utils.FindAppPath(), "Apps") + spotStat := spotifystatus.Get(spotifyPath) + ex, err := os.Executable() + if err != nil { + ex = "spicetify" + } - spotifyPath := filepath.Join(utils.FindAppPath(), "Apps") - spotStat := spotifystatus.Get(spotifyPath) + if updateStatus { cmds := []string{"backup", "apply"} if !spotStat.IsBackupable() { cmds = append([]string{"restore"}, cmds...) @@ -251,6 +251,15 @@ func main() { cmd = exec.Command(ex, strings.Join(commands[:], " ")) utils.CmdScanner(cmd) } + + if spotStat.IsBackupable() { + utils.PrintInfo("Spicetify is already up-to-date! If you're most likely running this command because Spicetify disappeared after Spotify updated, we'll attempt to fix it for you.") + cmd.Backup(version) + cmd.CheckStates() + cmd.InitSetting() + cmd.Apply(version) + restartSpotify() + } return } else { cmd.CheckUpdate(version) From 0ffd56cccf589441999ae0e031ad14fc600e6e0b Mon Sep 17 00:00:00 2001 From: ririxi Date: Fri, 2 Aug 2024 22:17:31 +0200 Subject: [PATCH 2/6] chore: change wording --- spicetify.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spicetify.go b/spicetify.go index d1be9e479d..92de53ada2 100644 --- a/spicetify.go +++ b/spicetify.go @@ -253,7 +253,7 @@ func main() { } if spotStat.IsBackupable() { - utils.PrintInfo("Spicetify is already up-to-date! If you're most likely running this command because Spicetify disappeared after Spotify updated, we'll attempt to fix it for you.") + utils.PrintInfo("Spicetify is already up-to-date! If you're using this command because Spicetify disappeared after Spotify updated, we'll attempt to fix it for you right now.") cmd.Backup(version) cmd.CheckStates() cmd.InitSetting() From 768619cbc4a82f87ac1b2bb89f0da0c1aa83921e Mon Sep 17 00:00:00 2001 From: ririxi Date: Fri, 2 Aug 2024 22:18:44 +0200 Subject: [PATCH 3/6] style: use lowercase `S` in `spicetify` to match it as in other places --- spicetify.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spicetify.go b/spicetify.go index 92de53ada2..71233cfbce 100644 --- a/spicetify.go +++ b/spicetify.go @@ -253,7 +253,7 @@ func main() { } if spotStat.IsBackupable() { - utils.PrintInfo("Spicetify is already up-to-date! If you're using this command because Spicetify disappeared after Spotify updated, we'll attempt to fix it for you right now.") + utils.PrintInfo("spicetify is already up-to-date! If you're using this command because spicetify disappeared after Spotify updated, we'll attempt to fix it for you right now.") cmd.Backup(version) cmd.CheckStates() cmd.InitSetting() From 42fbda8df13aaf9280679693d7058fabd7491d7e Mon Sep 17 00:00:00 2001 From: ririxi Date: Fri, 2 Aug 2024 22:43:42 +0200 Subject: [PATCH 4/6] chore: change wording x2 --- spicetify.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spicetify.go b/spicetify.go index 71233cfbce..959e2780ef 100644 --- a/spicetify.go +++ b/spicetify.go @@ -253,7 +253,7 @@ func main() { } if spotStat.IsBackupable() { - utils.PrintInfo("spicetify is already up-to-date! If you're using this command because spicetify disappeared after Spotify updated, we'll attempt to fix it for you right now.") + utils.PrintInfo("spicetify is already up-to-date! If you ran this command because spicetify disappeared after Spotify updated, we'll attempt to fix it for you right now.") cmd.Backup(version) cmd.CheckStates() cmd.InitSetting() From 1565b111c75c8ed8e11c95dc742ee5261f4327eb Mon Sep 17 00:00:00 2001 From: ririxi Date: Mon, 5 Aug 2024 20:03:33 +0200 Subject: [PATCH 5/6] fix: properly check for spotify status --- spicetify.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spicetify.go b/spicetify.go index 959e2780ef..e9b7d03b54 100644 --- a/spicetify.go +++ b/spicetify.go @@ -233,13 +233,13 @@ func main() { if slices.Contains(commands, "upgrade") || slices.Contains(commands, "update") { updateStatus := cmd.Update(version) spotifyPath := filepath.Join(utils.FindAppPath(), "Apps") - spotStat := spotifystatus.Get(spotifyPath) ex, err := os.Executable() if err != nil { ex = "spicetify" } if updateStatus { + spotStat := spotifystatus.Get(spotifyPath) cmds := []string{"backup", "apply"} if !spotStat.IsBackupable() { cmds = append([]string{"restore"}, cmds...) @@ -252,6 +252,7 @@ func main() { utils.CmdScanner(cmd) } + spotStat := spotifystatus.Get(spotifyPath) if spotStat.IsBackupable() { utils.PrintInfo("spicetify is already up-to-date! If you ran this command because spicetify disappeared after Spotify updated, we'll attempt to fix it for you right now.") cmd.Backup(version) @@ -260,6 +261,7 @@ func main() { cmd.Apply(version) restartSpotify() } + return } else { cmd.CheckUpdate(version) From 880211d7508981a3a24ba03218a1cb1a5dcdbf37 Mon Sep 17 00:00:00 2001 From: ririxi Date: Tue, 6 Aug 2024 19:28:55 +0200 Subject: [PATCH 6/6] chore: change `info` to `note` --- spicetify.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spicetify.go b/spicetify.go index e9b7d03b54..d42a5009a5 100644 --- a/spicetify.go +++ b/spicetify.go @@ -254,7 +254,7 @@ func main() { spotStat := spotifystatus.Get(spotifyPath) if spotStat.IsBackupable() { - utils.PrintInfo("spicetify is already up-to-date! If you ran this command because spicetify disappeared after Spotify updated, we'll attempt to fix it for you right now.") + utils.PrintNote("spicetify is already up-to-date! If you ran this command because spicetify disappeared after Spotify updated, we'll attempt to fix it for you right now.") cmd.Backup(version) cmd.CheckStates() cmd.InitSetting()