File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,10 @@ import (
99 "optimus/backend/png"
1010 "optimus/backend/webp"
1111 "os"
12+ "os/exec"
1213 "path"
1314 "path/filepath"
15+ goruntime "runtime"
1416 "strconv"
1517
1618 "github.com/wailsapp/wails/v2/pkg/runtime"
@@ -74,10 +76,18 @@ func (c *Config) GetAppConfig() map[string]interface{} {
7476 }
7577}
7678
77- // OpenOutputDir opens the output directory using the native system browser .
79+ // OpenOutputDir opens the output directory in the native file manager .
7880func (c * Config ) OpenOutputDir () error {
79- runtime .BrowserOpenURL (c .ctx , c .App .OutDir )
80- return nil
81+ var cmd * exec.Cmd
82+ switch goruntime .GOOS {
83+ case "darwin" :
84+ cmd = exec .Command ("open" , c .App .OutDir )
85+ case "windows" :
86+ cmd = exec .Command ("explorer" , c .App .OutDir )
87+ default :
88+ cmd = exec .Command ("xdg-open" , c .App .OutDir )
89+ }
90+ return cmd .Start ()
8191}
8292
8393// RestoreDefaults sets the app configuration to defaults.
You can’t perform that action at this time.
0 commit comments