diff options
| author | Jeff Carr <[email protected]> | 2024-11-07 01:25:12 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-07 01:25:12 -0600 |
| commit | 3c1b67066399d984d5d24ada85af94ad3169b184 (patch) | |
| tree | 21806efc672794137fb145f8f523dc5ffb2ddf6d /http.go | |
| parent | 2de5fd79554a3407f34e8b3adbb62da75fe7aa90 (diff) | |
try switching log() to http writes
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 { |
