deploy source에 다운로드 경로를 보내줌
This commit is contained in:
@ -3,6 +3,7 @@ package server
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
@ -41,10 +42,16 @@ func (h *houstonHandler) GetDeploySources(w http.ResponseWriter, r *http.Request
|
||||
|
||||
getVersions := func(name string) []string {
|
||||
var out []string
|
||||
files, _ := os.ReadDir(path.Join(h.deployPath, name))
|
||||
for _, fd := range files {
|
||||
vers, _ := os.ReadDir(path.Join(h.deployPath, name))
|
||||
for _, fd := range vers {
|
||||
if fd.IsDir() {
|
||||
out = append(out, fd.Name())
|
||||
ver := 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
|
||||
|
||||
Reference in New Issue
Block a user