fix: use direct file instead of embedded file for generate version

This commit is contained in:
Hintay 2025-02-04 00:09:31 +09:00
parent c774359531
commit de420ab6ff
No known key found for this signature in database
GPG key ID: 120FC7FF121F2F2D

View file

@ -10,8 +10,6 @@ import (
"os"
"path"
"runtime"
"github.com/0xJacky/Nginx-UI/app"
)
type VersionInfo struct {
@ -28,7 +26,7 @@ func main() {
}
basePath := path.Join(path.Dir(file), "../../")
versionFile, err := app.DistFS.Open("dist/version.json")
versionFile, err := os.Open(path.Join(basePath, "app/dist/version.json"))
if err != nil {
if errors.Is(err, fs.ErrNotExist) {
log.Print("\"dist/version.json\" not found, load from src instead")