fix: remove running `pickle` checking script on macOS (#201)

This commit is contained in:
Lykin 2024-05-09 11:04:51 +08:00
parent 70354c14ec
commit e8f76ce8ae
1 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,9 @@
package convutil package convutil
import "os/exec" import (
"os/exec"
"runtime"
)
type PickleConvert struct { type PickleConvert struct {
CmdConvert CmdConvert
@ -49,6 +52,14 @@ func NewPickleConvert() *PickleConvert {
} }
} }
// check if pickle available // check if pickle available
if runtime.GOOS == "darwin" {
// the xcode-select installation prompt may appear on macOS
// so check it manually in advance
if _, err = exec.LookPath("xcode-select"); err != nil {
return nil
}
}
if _, err = runCommand(c.DecodePath, "-c", "import pickle"); err != nil { if _, err = runCommand(c.DecodePath, "-c", "import pickle"); err != nil {
return nil return nil
} }