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

Function GetDebuggerPath

src/utils/watcher.go:96–119  ·  view source on GitHub ↗

GetDebuggerPath fetches opening debugger list from localhost and returns the Spotify one.

()

Source from the content-addressed store, hash-verified

94// GetDebuggerPath fetches opening debugger list from localhost and returns
95// the Spotify one.
96func GetDebuggerPath() string {
97 res, err := http.Get("http://localhost:9222/json/list")
98 if err != nil {
99 return ""
100 }
101
102 body, err := io.ReadAll(res.Body)
103 if err != nil {
104 return ""
105 }
106
107 var list []debugger
108 if err = json.Unmarshal(body, &list); err != nil {
109 return ""
110 }
111
112 for _, debugger := range list {
113 if strings.Contains(debugger.Url, "spotify") {
114 return debugger.WebSocketDebuggerUrl
115 }
116 }
117
118 return ""
119}
120
121// SendReload sends reload command to debugger Websocket server
122func SendReload(debuggerURL *string) error {

Callers 2

startDebuggerFunction · 0.92
SendReloadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected