diff options
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -17,14 +17,18 @@ func cleanURL(url string) string { } // send stuff to the socket and stdout -func msg(w http.ResponseWriter, s string) { - log.Info(s) - fmt.Fprintln(w, s) +func msg(w http.ResponseWriter, a ...any) { + if w == nil { + log.Info(a) + } else { + fmt.Fprintln(w, a) + } } func okHandler(w http.ResponseWriter, r *http.Request) { var route string route = cleanURL(r.URL.Path) + log.HttpMode(w) // common http args that can be set repoName := r.URL.Query().Get("repo") @@ -62,7 +66,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { } case "/doRelease": buttonDisable() - if doRelease() { + if doRelease(w) { buttonEnable() msg(w, "doRelease() worked") } else { |
