Refactor openlocation feature
This commit is contained in:
14
internal/openfolder/open_windows.go
Normal file
14
internal/openfolder/open_windows.go
Normal file
@@ -0,0 +1,14 @@
|
||||
//go:build windows
|
||||
|
||||
package openfolder
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func OpenLocation(path string) error {
|
||||
// explorer requires backslashes.
|
||||
p := strings.ReplaceAll(path, "/", "\\")
|
||||
return exec.Command("explorer.exe", p).Start()
|
||||
}
|
||||
Reference in New Issue
Block a user