This commit is contained in:
Iris Lightshard 2023-09-01 22:42:39 -06:00
parent 2bb6d24546
commit 734eab3cfd
Signed by: nilix
GPG Key ID: F54E0D40695271D4
3 changed files with 129 additions and 130 deletions

View File

@ -1,13 +1,12 @@
package main
import (
"encoding/json"
"fmt"
"html/template"
"net/http"
"os"
"os/exec"
"net/http"
"path/filepath"
"hacklab.nilfm.cc/quartzgun/renderer"
@ -55,7 +54,7 @@ func runJob(secret string, next http.Handler) http.Handler {
// create working dir
workingDir := filepath.Join("working", owner, repo, obj)
if (os.MkdirAll(workingDir, 0750) != nil) {
if os.MkdirAll(workingDir, 0750) != nil {
w.WriteHeader(500)
return
}
@ -121,7 +120,7 @@ func run(args []string) error {
rtr.Get(`/status/(?P<owner>[^/]+)/(?P<repo>\S+)`, seeJobsForRepo(renderer.JSON("data")))
rtr.Get(`/status/(?P<owner>[^/]+)/(?P<repo>[^/]+)/(?P<object>\S+)`, seeJobsForObject(renderer.JSON("data")))
http.ListenAndServe(":9999", rtr);
http.ListenAndServe(":9999", rtr)
return nil
}