🎨 Improve Tesseract OCR installation check on macOS https://github.com/siyuan-note/siyuan/issues/7107

This commit is contained in:
Liang Ding 2023-04-28 15:22:41 +08:00
parent 770c65f616
commit 48e8c9f86f
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -189,6 +189,12 @@ func getTesseractVer() (ret string) {
cmd = exec.Command(TesseractBin, "--version")
gulu.CmdAttr(cmd)
data, err = cmd.CombinedOutput()
if nil != err && strings.Contains(err.Error(), "executable file not found") {
TesseractBin = "/opt/homebrew/bin/tesseract"
cmd = exec.Command(TesseractBin, "--version")
gulu.CmdAttr(cmd)
data, err = cmd.CombinedOutput()
}
}
}
if nil != err {