Compare commits
1 Commits
bbe340f559
...
b5bbcba4be
| Author | SHA1 | Date | |
|---|---|---|---|
| b5bbcba4be |
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user