client도 storageroot지원

This commit is contained in:
2023-06-14 14:16:47 +09:00
parent 46aedbe767
commit 279c9f47f0
7 changed files with 60 additions and 36 deletions

View File

@ -3,6 +3,7 @@ package shared
import (
"io/fs"
"os"
"path"
"strings"
)
@ -89,9 +90,10 @@ func CompareVersionString(lhs, rhs ParsedVersionString) int {
return len(lhs) - len(rhs)
}
func FindLastestVersion(root string) (string, error) {
func FindLastestVersion(storageRoot, name string) (string, error) {
// 최신 버전을 찾음
entries, err := os.ReadDir(root)
targetPath := path.Join(storageRoot, name)
entries, err := os.ReadDir(targetPath)
if err != nil {
return "", err
}