improve error messages
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -51,6 +52,10 @@ func (a *App) InstallPyDep(python string, cnMirror bool) (string, error) {
|
||||
if python == "" {
|
||||
python, err = GetPython()
|
||||
if runtime.GOOS == "windows" {
|
||||
python, err = filepath.Abs(python)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
python = `"` + python + `"`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,19 +115,11 @@ func GetPython() (string, error) {
|
||||
if err != nil {
|
||||
return "", errors.New("failed to unzip python")
|
||||
} else {
|
||||
python, err := filepath.Abs("py310/python.exe")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return python, nil
|
||||
return "py310/python.exe", nil
|
||||
}
|
||||
}
|
||||
} else {
|
||||
python, err := filepath.Abs("py310/python.exe")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return python, nil
|
||||
return "py310/python.exe", nil
|
||||
}
|
||||
case "darwin":
|
||||
return "python3", nil
|
||||
|
||||
Reference in New Issue
Block a user