1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-08 06:28:27 -04:00

core: some fixes for embedded distribution, VERSION file, matugen

scripts, and embed scripts
This commit is contained in:
bbedward
2026-07-19 19:03:10 -04:00
parent dc4916b9e0
commit e300b14dde
4 changed files with 56 additions and 24 deletions
+13 -2
View File
@@ -7,13 +7,15 @@ package shellembed
import (
"io/fs"
"path"
"strings"
"github.com/AvengeMedia/dankgo/shellapp/shellfs"
)
const (
distRoot = "dist"
shellEntry = "shell.qml"
distRoot = "dist"
shellEntry = "shell.qml"
versionFile = "VERSION"
)
// Available reports whether this binary was built with the embedded UI
@@ -23,6 +25,15 @@ func Available() bool {
return err == nil && !info.IsDir()
}
// Version reports the embedded UI's VERSION, empty when unavailable.
func Version() string {
data, err := fs.ReadFile(distFS, path.Join(distRoot, versionFile))
if err != nil {
return ""
}
return strings.TrimSpace(string(data))
}
func Extract(baseDir string) (string, error) {
sub, err := fs.Sub(distFS, distRoot)
if err != nil {