Compare commits
1 Commits
bbe340f559
...
b5bbcba4be
| Author | SHA1 | Date | |
|---|---|---|---|
| b5bbcba4be |
@ -3,7 +3,6 @@ package server
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
@ -42,16 +41,10 @@ func (h *houstonHandler) GetDeploySources(w http.ResponseWriter, r *http.Request
|
||||
|
||||
getVersions := func(name string) []string {
|
||||
var out []string
|
||||
vers, _ := os.ReadDir(path.Join(h.deployPath, name))
|
||||
for _, fd := range vers {
|
||||
files, _ := os.ReadDir(path.Join(h.deployPath, name))
|
||||
for _, fd := range files {
|
||||
if fd.IsDir() {
|
||||
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)
|
||||
out = append(out, fd.Name())
|
||||
}
|
||||
}
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user