lockbox

password manager
Log | Files | Refs | README | LICENSE

commit db2488f471d2cb412c546ae4937fc40bfbc833f3
parent 7c13b3a2e4e705bdb7fe47bf61ea0f063ea3f72c
Author: Sean Enck <sean@ttypty.com>
Date:   Wed,  1 Feb 2023 18:42:57 -0500

improve platform detection

Diffstat:
Mcmd/vers.txt | 4++--
Minternal/platform/core.go | 8++++----
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cmd/vers.txt b/cmd/vers.txt @@ -1 +1 @@ -v23.01.03 -\ No newline at end of file +v23.02.00 +\ No newline at end of file diff --git a/internal/platform/core.go b/internal/platform/core.go @@ -49,13 +49,13 @@ func NewPlatform() (System, error) { if err != nil { return Unknown, err } - raw := strings.TrimSpace(string(b)) + raw := strings.ToLower(strings.TrimSpace(string(b))) parts := strings.Split(raw, " ") switch parts[0] { - case "Darwin": + case "darwin": return MacOS, nil - case "Linux": - if strings.Contains(raw, "microsoft-standard-WSL2") { + case "linux": + if strings.Contains(raw, "microsoft-standard-wsl") { return WindowsLinux, nil } if strings.TrimSpace(os.Getenv("WAYLAND_DISPLAY")) == "" {