|
@@ -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)
|