🐛 Pandoc is not initialized in some cases Fix https://github.com/siyuan-note/siyuan/issues/8533

This commit is contained in:
Daniel 2023-06-15 10:15:13 +08:00
parent e93c62e49f
commit a515a4f992
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
7 changed files with 33 additions and 5 deletions

View file

@ -19,7 +19,6 @@ package model
import (
"bytes"
"fmt"
"github.com/sashabaranov/go-openai"
"os"
"path/filepath"
"runtime"
@ -35,6 +34,8 @@ import (
"github.com/Xuanwo/go-locale"
"github.com/dustin/go-humanize"
"github.com/getsentry/sentry-go"
"github.com/sashabaranov/go-openai"
"github.com/siyuan-note/eventbus"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/conf"
@ -892,3 +893,15 @@ func upgradeUserGuide() {
index(boxID)
}
}
func init() {
subscribeConfEvents()
}
func subscribeConfEvents() {
eventbus.Subscribe(util.EvtConfPandocInitialized, func() {
logging.LogInfof("pandoc initialized, set pandoc bin to [%s]", util.PandocBinPath)
Conf.Export.PandocBin = util.PandocBinPath
Conf.Save()
})
}