diff --git a/kernel/util/pandoc.go b/kernel/util/pandoc.go index 090a4dddb..164ca054a 100644 --- a/kernel/util/pandoc.go +++ b/kernel/util/pandoc.go @@ -58,11 +58,6 @@ func ConvertPandoc(dir string, args ...string) (path string, err error) { } func Pandoc(from, to, o, content string) (err error) { - if "" == PandocBinPath || ContainerStd != Container { - err = ErrPandocNotFound - return - } - if "" == from || "" == to || "md" == to { if err = gulu.File.WriteFileSafer(o, []byte(content), 0644); nil != err { logging.LogErrorf("write export markdown file [%s] failed: %s", o, err) @@ -70,6 +65,11 @@ func Pandoc(from, to, o, content string) (err error) { return } + if "" == PandocBinPath || ContainerStd != Container { + err = ErrPandocNotFound + return + } + dir := filepath.Join(WorkspaceDir, "temp", "convert", "pandoc", gulu.Rand.String(7)) if err = os.MkdirAll(dir, 0755); nil != err { logging.LogErrorf("mkdir [%s] failed: [%s]", dir, err)