Add companion application
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
|
||||
import "os/exec"
|
||||
|
||||
// openOSPath asks Windows to open a file in the default app, or a folder in
|
||||
// Explorer. `cmd /c start` handles default-handler dispatch for files; the
|
||||
// empty "" argument is the window title required by start.
|
||||
func openOSPath(p string, isFolder bool) error {
|
||||
if isFolder {
|
||||
return exec.Command("explorer.exe", p).Start()
|
||||
}
|
||||
return exec.Command("cmd", "/c", "start", "", p).Start()
|
||||
}
|
||||
Reference in New Issue
Block a user