Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(update): run backup apply for stock spotify #3124

Merged
merged 7 commits into from
Aug 6, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions spicetify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand All @@ -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 ran this command because spicetify disappeared after Spotify updated, we'll attempt to fix it for you right now.")
rxri marked this conversation as resolved.
Show resolved Hide resolved
cmd.Backup(version)
cmd.CheckStates()
cmd.InitSetting()
cmd.Apply(version)
restartSpotify()
}
return
} else {
cmd.CheckUpdate(version)
Expand Down