38
platform_other.go
Normal file
38
platform_other.go
Normal file
@@ -0,0 +1,38 @@
|
||||
//go:build !windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
const nativeDialogs = false
|
||||
|
||||
func hideConsole(cmd *exec.Cmd) {}
|
||||
|
||||
func listRoots() []string { return []string{"/"} }
|
||||
|
||||
func openBrowser(url string, preferDefault bool) error {
|
||||
if runtime.GOOS == "darwin" {
|
||||
return exec.Command("open", url).Start()
|
||||
}
|
||||
return exec.Command("xdg-open", url).Start()
|
||||
}
|
||||
|
||||
func revealInFileManager(path string) error {
|
||||
if runtime.GOOS == "darwin" {
|
||||
return exec.Command("open", "-R", path).Start()
|
||||
}
|
||||
return exec.Command("xdg-open", filepath.Dir(path)).Start()
|
||||
}
|
||||
|
||||
func waitBeforeExit() {}
|
||||
|
||||
var errNoDialogs = errors.New("native file dialogs are not supported on this platform")
|
||||
|
||||
func nativeOpenDialog(title, dir string) ([]string, error) { return nil, errNoDialogs }
|
||||
|
||||
func nativeSaveDialog(title, path string) (string, error) { return "", errNoDialogs }
|
||||
Reference in New Issue
Block a user