mirror of
https://github.com/Cheviiot/Vintner.git
synced 2026-08-03 15:57:24 +00:00
FindWine's error used to just say wine64/wine weren't on PATH, with no
next step - surface the exact install fix ("install the wine
package") instead of leaving the reader to figure that out
themselves.
19 lines
448 B
Go
19 lines
448 B
Go
package wineenv
|
|
|
|
import (
|
|
"fmt"
|
|
"os/exec"
|
|
)
|
|
|
|
// FindWine locates the wine binary to use, preferring wine64 like the
|
|
// original wrappers (`command -v wine64 || command -v wine`).
|
|
func FindWine() (string, error) {
|
|
if p, err := exec.LookPath("wine64"); err == nil {
|
|
return p, nil
|
|
}
|
|
if p, err := exec.LookPath("wine"); err == nil {
|
|
return p, nil
|
|
}
|
|
return "", fmt.Errorf("neither wine64 nor wine found in PATH (install the wine package)")
|
|
}
|