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

Function readRemoteCssMap

src/preprocess/preprocess.go:52–65  ·  view source on GitHub ↗
(tag string, cssTranslationMap *map[string]string)

Source from the content-addressed store, hash-verified

50}
51
52func readRemoteCssMap(tag string, cssTranslationMap *map[string]string) error {
53 var cssMapURL string = "https://raw.githubusercontent.com/spicetify/cli/" + tag + "/css-map.json"
54 cssMapResp, err := http.Get(cssMapURL)
55 if err != nil {
56 return err
57 } else {
58 err := json.NewDecoder(cssMapResp.Body).Decode(cssTranslationMap)
59 if err != nil {
60 utils.PrintWarning("Remote CSS map JSON malformed.")
61 return err
62 }
63 }
64 return nil
65}
66
67func readLocalCssMap(cssTranslationMap *map[string]string) error {
68 cssMapLocalPath := path.Join(utils.GetExecutableDir(), "css-map.json")

Callers 1

StartFunction · 0.85

Calls 1

PrintWarningFunction · 0.92

Tested by

no test coverage detected