39 lines
895 B
Go
39 lines
895 B
Go
//go:build !windows && !linux
|
|
|
|
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(k fileKind, dir string) ([]string, error) { return nil, errNoDialogs }
|
|
|
|
func nativeSaveDialog(title, path string) (string, error) { return "", errNoDialogs }
|