Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Liang Ding48e8c9f86f55
diff --git a/kernel/util/tesseract.go b/kernel/util/tesseract.go
index 0e06e7bfc4..891f285cd2 100644
--- a/kernel/util/tesseract.go
+++ b/kernel/util/tesseract.go
@@ -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 {