diff --git a/internal/native/native.go b/internal/native/native.go index 69551b9b..90fda520 100644 --- a/internal/native/native.go +++ b/internal/native/native.go @@ -111,3 +111,8 @@ func (n *Native) DoNotUseThisIsForCrashTestingOnly() { crash() } + +// GetLVGLVersion returns the LVGL version +func GetLVGLVersion() string { + return uiGetLVGLVersion() +} diff --git a/scripts/dev_deploy.sh b/scripts/dev_deploy.sh index 9bfb6691..1ff9296b 100755 --- a/scripts/dev_deploy.sh +++ b/scripts/dev_deploy.sh @@ -16,6 +16,7 @@ show_help() { echo " --run-go-tests-only Run go tests and exit" echo " --skip-ui-build Skip frontend/UI build" echo " --skip-native-build Skip native build" + echo " --disable-docker Disable docker build" echo " -i, --install Build for release and install the app" echo " --help Display this help message" echo @@ -36,7 +37,7 @@ LOG_TRACE_SCOPES="${LOG_TRACE_SCOPES:-jetkvm,cloud,websocket,native,jsonrpc}" RUN_GO_TESTS=false RUN_GO_TESTS_ONLY=false INSTALL_APP=false -BUILD_IN_DOCKER=false +BUILD_IN_DOCKER=true DOCKER_BUILD_DEBUG=false DOCKER_BUILD_TAG=ghcr.io/jetkvm/buildkit:latest @@ -63,8 +64,8 @@ while [[ $# -gt 0 ]]; do RESET_USB_HID_DEVICE=true shift ;; - --build-in-docker) - BUILD_IN_DOCKER=true + --disable-docker) + BUILD_IN_DOCKER=false shift ;; --docker-build-debug) diff --git a/version.go b/version.go index 5d01808c..b32eca47 100644 --- a/version.go +++ b/version.go @@ -5,7 +5,9 @@ import ( "encoding/json" "html/template" "runtime" + "strings" + "github.com/jetkvm/kvm/internal/native" "github.com/prometheus/common/version" ) @@ -32,11 +34,9 @@ func GetVersionData(isJson bool) ([]byte, error) { "platform": runtime.GOOS + "/" + runtime.GOARCH, } - if nativeInstance != nil { - lvglVersion, err := nativeInstance.GetLVGLVersion() - if err == nil { - m["lvglVersion"] = lvglVersion - } + lvglVersion := native.GetLVGLVersion() + if lvglVersion != "" { + m["lvglVersion"] = lvglVersion } if isJson { @@ -47,7 +47,11 @@ func GetVersionData(isJson bool) ([]byte, error) { return jsonData, nil } - t := template.Must(template.New("version").Parse(versionInfoTmpl)) + t := template.Must( + template.New("version").Parse( + strings.TrimSpace(versionInfoTmpl), + ), + ) var buf bytes.Buffer if err := t.ExecuteTemplate(&buf, "version", m); err != nil {