From 99c93dc174206312cee4a09c51a1e508164944e6 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sun, 20 Jun 2021 13:21:47 -0700 Subject: [PATCH] Fix Profile Directory file:// URI for Windows --- pkg/windows/settings.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/windows/settings.go b/pkg/windows/settings.go index 3a657de..448cade 100644 --- a/pkg/windows/settings.go +++ b/pkg/windows/settings.go @@ -1,6 +1,8 @@ package windows import ( + "strings" + "git.kirsle.net/apps/doodle/pkg/balance" "git.kirsle.net/apps/doodle/pkg/log" "git.kirsle.net/apps/doodle/pkg/native" @@ -274,7 +276,11 @@ func (c Settings) makeOptionsTab(Width, Height int) *ui.Frame { { Label: "Open profile directory", Fn: func() { - native.OpenURL("file://" + userdir.ProfileDirectory) + path := strings.ReplaceAll(userdir.ProfileDirectory, "\\", "/") + if path[0] != '/' { + path = "/" + path + } + native.OpenURL("file://" + path) }, Style: &balance.ButtonPrimary, },