1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-06-28 05:25:11 +00:00

Show version number in about dialog (#28)

This commit is contained in:
2023-06-06 21:52:02 +02:00
committed by GitHub
parent 775e4d98d8
commit b29b534b2f
11 changed files with 51 additions and 8 deletions

View File

@ -10,6 +10,7 @@ import (
"path"
"path/filepath"
"runtime"
"strings"
"github.com/garraflavatra/rolens/internal/ui"
"github.com/ncruces/zenity"
@ -21,6 +22,7 @@ type EnvironmentInfo struct {
Arch string `json:"arch"`
BuildType string `json:"buildType"`
Platform string `json:"platform"`
Version string `json:"version"`
HasMongoExport bool `json:"hasMongoExport"`
HasMongoDump bool `json:"hasMongoDump"`
@ -38,8 +40,9 @@ type App struct {
ui *ui.UI
}
func NewApp() *App {
func NewApp(version string) *App {
a := &App{}
a.Env.Version = strings.TrimSpace(version)
_, err := exec.LookPath("mongodump")
a.Env.HasMongoDump = err == nil