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