An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve ocr bin detect https://github.com/siyuan-note/siyuan/issues/7107#issuecomment-3541763667
Daniel8e9cc609096a
diff --git a/kernel/util/ocr.go b/kernel/util/ocr.goindex ba01cc3f7e..a9370071e1 100644--- a/kernel/util/ocr.go+++ b/kernel/util/ocr.go@@ -361,17 +361,21 @@ func getTesseractVer() (ret string) {gulu.CmdAttr(cmd)data, err := cmd.CombinedOutput()if err != nil {- if strings.Contains(err.Error(), "executable file not found") {+ errMsg := strings.ToLower(err.Error())+ if strings.Contains(errMsg, "executable file not found") || strings.Contains(errMsg, "no such file or directory") {// macOS 端 Tesseract OCR 安装后不识别 https://github.com/siyuan-note/siyuan/issues/7107TesseractBin = "/usr/local/bin/tesseract"cmd = exec.Command(TesseractBin, "--version")gulu.CmdAttr(cmd)data, err = cmd.CombinedOutput()- if err != nil && 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 err != nil {+ errMsg = strings.ToLower(err.Error())+ if strings.Contains(errMsg, "executable file not found") || strings.Contains(errMsg, "no such file or directory") {+ TesseractBin = "/opt/homebrew/bin/tesseract"+ cmd = exec.Command(TesseractBin, "--version")+ gulu.CmdAttr(cmd)+ data, err = cmd.CombinedOutput()+ }}}}