MCPcopy
hub / github.com/spicetify/cli / main

Function main

spicetify.go:144–365  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

142}
143
144func main() {
145 if slices.Contains(commands, "config-dir") {
146 cmd.ShowConfigDirectory()
147 return
148 }
149
150 // Unchainable commands
151 switch commands[0] {
152 case "config":
153 commands = commands[1:]
154 if len(commands) == 0 {
155 cmd.DisplayAllConfig()
156 } else if len(commands) == 1 {
157 cmd.DisplayConfig(commands[0])
158 } else {
159 cmd.EditConfig(commands)
160 }
161 return
162
163 case "color":
164 commands = commands[1:]
165 if len(commands) == 0 {
166 cmd.DisplayColors()
167 } else {
168 cmd.EditColor(commands)
169 }
170 return
171
172 case "spotify-updates":
173 cmd.InitPaths()
174 commands = commands[1:]
175 if len(commands) == 0 {
176 utils.PrintError("No parameter given. It has to be \"block\" or \"unblock\".")
177 return
178 }
179 param := commands[0]
180 switch param {
181 case "block":
182 cmd.BlockSpotifyUpdates(true)
183 case "unblock":
184 cmd.BlockSpotifyUpdates(false)
185 default:
186 utils.PrintError("Invalid parameter. It has to be \"block\" or \"unblock\".")
187 }
188 return
189
190 case "path":
191 cmd.InitPaths()
192 commands = commands[1:]
193 path, err := (func() (string, error) {
194 if styleFocus {
195 if len(commands) == 0 {
196 return cmd.ThemeAllAssetsPath()
197 }
198 return cmd.ThemeAssetPath(commands[0])
199 } else if extensionFocus {
200 if len(commands) == 0 {
201 return cmd.ExtensionAllPath()

Callers

nothing calls this directly

Calls 15

ShowConfigDirectoryFunction · 0.92
DisplayAllConfigFunction · 0.92
DisplayConfigFunction · 0.92
EditConfigFunction · 0.92
DisplayColorsFunction · 0.92
EditColorFunction · 0.92
InitPathsFunction · 0.92
PrintErrorFunction · 0.92
BlockSpotifyUpdatesFunction · 0.92
ThemeAllAssetsPathFunction · 0.92
ThemeAssetPathFunction · 0.92
ExtensionAllPathFunction · 0.92

Tested by

no test coverage detected