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

Function EditConfig

src/cmd/config.go:14–37  ·  view source on GitHub ↗

EditConfig changes one or multiple config value

(args []string)

Source from the content-addressed store, hash-verified

12
13// EditConfig changes one or multiple config value
14func EditConfig(args []string) {
15 for len(args) >= 2 {
16 field := args[0]
17 value := args[1]
18
19 switch field {
20 case "extensions", "custom_apps":
21 arrayType(featureSection, field, value)
22 case "spotify_launch_flags":
23 continue
24 case "prefs_path", "spotify_path", "current_theme", "color_scheme":
25 stringType(settingSection, field, value)
26
27 default:
28 toggleType(field, value)
29 }
30
31 args = args[2:]
32 }
33
34 if err := cfg.Write(); err != nil {
35 utils.PrintWarning(fmt.Sprintf("Failed to save config: %s", err.Error()))
36 }
37}
38
39// DisplayAllConfig displays all configs in all sections
40func DisplayAllConfig() {

Callers 1

mainFunction · 0.92

Calls 5

PrintWarningFunction · 0.92
arrayTypeFunction · 0.85
stringTypeFunction · 0.85
toggleTypeFunction · 0.85
WriteMethod · 0.65

Tested by

no test coverage detected