diff --git a/goutil.go b/goutil.go index eee5b74..386f95a 100644 --- a/goutil.go +++ b/goutil.go @@ -129,7 +129,8 @@ func StrSlice(sl []string, start int, end int) []string { func OpenInDefaultApp(filename string, wait bool) error { var cmd *exec.Cmd - switch goos := runtime.GOOS; goos { + goos := runtime.GOOS + switch goos { case "windows": cmd = exec.Command(filepath.Join(os.Getenv("SYSTEMROOT"), "System32", "rundll32.exe"), "url.dll,FileProtocolHandler", filename) case "darwin": @@ -138,7 +139,11 @@ func OpenInDefaultApp(filename string, wait bool) error { cmd = exec.Command("xdg-open", filename) } if wait { - return cmd.Run() + err := cmd.Run() + if goos == "windows" { + AskFor("Press Enter when you're done") + } + return err } else { return cmd.Start() }