Fix opening logs folder on Windows

This commit is contained in:
Stu Leak 2026-01-04 16:17:46 -05:00
parent eb236f48d3
commit eed6f8e80e

12
main.go
View File

@ -477,7 +477,11 @@ func openFolder(path string) error {
var cmd *exec.Cmd
switch runtime.GOOS {
case "windows":
cmd = utils.CreateCommandRaw("explorer", path)
p := filepath.Clean(filepath.FromSlash(path))
if abs, err := filepath.Abs(p); err == nil {
p = abs
}
cmd = utils.CreateCommandRaw("cmd", "/c", "start", "", p)
case "darwin":
cmd = utils.CreateCommandRaw("open", path)
default:
@ -494,7 +498,11 @@ func openFile(path string) error {
var cmd *exec.Cmd
switch runtime.GOOS {
case "windows":
cmd = utils.CreateCommandRaw("explorer", path)
p := filepath.Clean(filepath.FromSlash(path))
if abs, err := filepath.Abs(p); err == nil {
p = abs
}
cmd = utils.CreateCommandRaw("cmd", "/c", "start", "", p)
case "darwin":
cmd = utils.CreateCommandRaw("open", path)
default: