From e8f76ce8ae561f4521ce4fbb2e0c0e0982989342 Mon Sep 17 00:00:00 2001 From: Lykin <137850705+tiny-craft@users.noreply.github.com> Date: Thu, 9 May 2024 11:04:51 +0800 Subject: [PATCH] fix: remove running `pickle` checking script on macOS (#201) --- backend/utils/convert/pickle_convert.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/utils/convert/pickle_convert.go b/backend/utils/convert/pickle_convert.go index 4d945d0..61279b6 100644 --- a/backend/utils/convert/pickle_convert.go +++ b/backend/utils/convert/pickle_convert.go @@ -1,6 +1,9 @@ package convutil -import "os/exec" +import ( + "os/exec" + "runtime" +) type PickleConvert struct { CmdConvert @@ -49,6 +52,14 @@ func NewPickleConvert() *PickleConvert { } } // 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 { return nil }