File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -150,19 +150,19 @@ func main() {
150
150
}
151
151
return
152
152
153
- case "block -updates" :
153
+ case "spotify -updates" :
154
154
commands = commands [1 :]
155
155
if len (commands ) == 0 {
156
- utils .PrintError ("No parameter given. It has to be \" on \" or \" off \" ." )
156
+ utils .PrintError ("No parameter given. It has to be \" block \" or \" unblock \" ." )
157
157
return
158
158
}
159
159
param := commands [0 ]
160
- if param == "on " {
160
+ if param == "block " {
161
161
cmd .BlockSpotifyUpdates (true )
162
- } else if param == "off " {
162
+ } else if param == "unblock " {
163
163
cmd .BlockSpotifyUpdates (false )
164
164
} else {
165
- utils .PrintError ("Invalid parameter. It has to be \" on \" or \" off \" ." )
165
+ utils .PrintError ("Invalid parameter. It has to be \" block \" or \" unblock \" ." )
166
166
}
167
167
return
168
168
@@ -371,7 +371,7 @@ watch Enter watch mode.
371
371
restart Restart Spotify client.
372
372
373
373
` + utils .Bold ("NON-CHAINABLE COMMANDS" ) + `
374
- block -updates Blocks Spotify updates. Patches spotify executable. Accepts "on " or "off " as parameter.
374
+ spotify -updates Blocks Spotify updates. Patches spotify executable. Accepts "block " or "unblock " as parameter.
375
375
376
376
path Prints path of Spotify's executable, userdata, and more.
377
377
1. Print executable path:
Original file line number Diff line number Diff line change @@ -11,13 +11,15 @@ import (
11
11
)
12
12
13
13
// Block spotify updates. Taken from https://github.com/Delusoire/bespoke-cli/blob/main/cmd/spotify/update.go
14
- func BlockSpotifyUpdates (enabled bool ) {
14
+ func BlockSpotifyUpdates (disabled bool ) {
15
+ if runtime .GOOS == "linux" {
16
+ utils .PrintError ("Auto-updates on linux should be disabled in package manager you installed spotify with." )
17
+ return
18
+ }
15
19
spotifyExecPath := GetSpotifyPath ()
16
20
switch runtime .GOOS {
17
21
case "windows" :
18
22
spotifyExecPath = filepath .Join (spotifyExecPath , "Spotify.exe" )
19
- case "linux" :
20
- spotifyExecPath = filepath .Join (spotifyExecPath , "spotify" )
21
23
case "darwin" :
22
24
spotifyExecPath = filepath .Join (spotifyExecPath , "Spotify" )
23
25
}
@@ -39,12 +41,12 @@ func BlockSpotifyUpdates(enabled bool) {
39
41
return
40
42
}
41
43
var str , msg string
42
- if enabled {
43
- str = "v2/update"
44
- msg = "Enabled"
45
- } else {
44
+ if disabled {
46
45
str = "no/thanks"
47
46
msg = "Disabled"
47
+ } else {
48
+ str = "v2/update"
49
+ msg = "Enabled"
48
50
}
49
51
file .WriteAt ([]byte (str ), int64 (i + 15 ))
50
52
utils .PrintSuccess (msg + " Spotify updates!" )
You can’t perform that action at this time.
0 commit comments