Fix usage of Box.Bytes causing depreciation message (#295)

* Add release make target

* Use Box.Find now that Box.Bytes is depreciated

Pretty much directly mocked off of the post-depreciation implementation
of Box.Bytes in packr. In theory we should totally be checking the
returned error but I'm lazy.
This commit is contained in:
FleetingOrchard
2019-12-29 04:53:16 +11:00
committed by StashAppDev
parent 52dd0197ee
commit b31af52d41
2 changed files with 4 additions and 2 deletions

View File

@@ -129,7 +129,7 @@ func Start() {
r.HandleFunc("/setup*", func(w http.ResponseWriter, r *http.Request) {
ext := path.Ext(r.URL.Path)
if ext == ".html" || ext == "" {
data := setupUIBox.Bytes("index.html")
data, _ := setupUIBox.Find("index.html")
_, _ = w.Write(data)
} else {
r.URL.Path = strings.Replace(r.URL.Path, "/setup", "", 1)
@@ -193,7 +193,7 @@ func Start() {
r.HandleFunc("/*", func(w http.ResponseWriter, r *http.Request) {
ext := path.Ext(r.URL.Path)
if ext == ".html" || ext == "" {
data := uiBox.Bytes("index.html")
data, _ := uiBox.Find("index.html")
_, _ = w.Write(data)
} else {
http.FileServer(uiBox).ServeHTTP(w, r)