@@ -18,10 +18,8 @@ func Backup() {
18
18
backupVersion := backupSection .Key ("version" ).MustString ("" )
19
19
curBackupStatus := backupstatus .Get (prefsPath , backupFolder , backupVersion )
20
20
if curBackupStatus != backupstatus .EMPTY {
21
- utils .PrintWarning ("There is available backup, clear current backup first! " )
21
+ utils .PrintInfo ("There is available backup, clear current backup: " )
22
22
ClearBackup ()
23
- backupSection .Key ("version" ).SetValue ("" )
24
- cfg .Write ()
25
23
}
26
24
27
25
utils .PrintBold ("Backing up app files:" )
@@ -92,7 +90,8 @@ func ClearBackup() {
92
90
curSpotifystatus := spotifystatus .Get (spotifyPath )
93
91
94
92
if curSpotifystatus != spotifystatus .STOCK && ! quiet {
95
- if ! utils .ReadAnswer ("Before clearing backup, make sure you have restored or re-installed Spotify to original state. Continue? [y/N]: " , false ) {
93
+ utils .PrintWarning ("Before clearing backup, please restore or re-install Spotify to stock state." )
94
+ if ! utils .ReadAnswer ("Continue clearing anyway? [y/N]: " , false ) {
96
95
os .Exit (1 )
97
96
}
98
97
}
@@ -121,16 +120,21 @@ func ClearBackup() {
121
120
func Restore () {
122
121
backupVersion := backupSection .Key ("version" ).MustString ("" )
123
122
curBackupStatus := backupstatus .Get (prefsPath , backupFolder , backupVersion )
123
+ curSpotifystatus := spotifystatus .Get (spotifyPath )
124
124
125
125
if curBackupStatus == backupstatus .EMPTY {
126
126
utils .PrintError (`You haven't backed up.` )
127
+ if curSpotifystatus != spotifystatus .STOCK {
128
+ utils .PrintWarning (`But Spotify cannot be backed up at this state. Please re-install Spotify then run "spicetify backup"` )
129
+ }
127
130
os .Exit (1 )
128
131
} else if curBackupStatus == backupstatus .OUTDATED {
129
- if ! quiet {
130
- utils .PrintWarning ("Spotify version and backup version are mismatched." )
131
- if ! utils .ReadAnswer ("Continue restoring anyway? [y/N] " , false ) {
132
- os .Exit (1 )
133
- }
132
+ utils .PrintWarning ("Spotify version and backup version are mismatched." )
133
+ if curSpotifystatus == spotifystatus .STOCK {
134
+ utils .PrintInfo (`Spotify is at stock state. Run "spicetify backup" to backup current Spotify version.` )
135
+ }
136
+ if ! quiet && ! utils .ReadAnswer ("Continue restoring anyway? [y/N] " , false ) {
137
+ os .Exit (1 )
134
138
}
135
139
}
136
140
0 commit comments