Compare commits

..

1 Commits

Author SHA1 Message Date
b5bbcba4be kd live는 go 1.18 2023-06-22 17:16:50 +09:00

View File

@ -3,7 +3,6 @@ package server
import ( import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt"
"io" "io"
"io/fs" "io/fs"
"net/http" "net/http"
@ -42,16 +41,10 @@ func (h *houstonHandler) GetDeploySources(w http.ResponseWriter, r *http.Request
getVersions := func(name string) []string { getVersions := func(name string) []string {
var out []string var out []string
vers, _ := os.ReadDir(path.Join(h.deployPath, name)) files, _ := os.ReadDir(path.Join(h.deployPath, name))
for _, fd := range vers { for _, fd := range files {
if fd.IsDir() { if fd.IsDir() {
ver := fd.Name() out = append(out, fd.Name())
files, _ := os.ReadDir(path.Join(h.deployPath, name, ver))
if len(files) > 0 {
downloadpath := path.Join(h.deployPath, name, ver, files[0].Name())
ver = fmt.Sprintf("%s:%s", ver, downloadpath)
}
out = append(out, ver)
} }
} }
return out return out