5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-12 15:09:33 +08:00
wails/v3/internal/doctor/doctor_linux.go
2023-09-04 19:46:07 +10:00

41 lines
770 B
Go

//go:build linux
package doctor
import (
"github.com/wailsapp/wails/v3/internal/doctor/packagemanager"
"github.com/wailsapp/wails/v3/internal/operatingsystem"
)
func getInfo() (map[string]string, bool) {
result := make(map[string]string)
ok := true
info, _ := operatingsystem.Info()
pm := packagemanager.Find(info.ID)
deps, _ := packagemanager.Dependencies(pm)
for _, dep := range deps {
var status string
switch true {
case !dep.Installed:
if dep.Optional {
status = "[Optional] "
} else {
ok = false
}
status += "not installed."
if dep.InstallCommand != "" {
status += " Install with: " + dep.InstallCommand
}
case dep.Version != "":
status = dep.Version
}
result[dep.Name] = status
}
return result, ok
}