Fix windows export pdf

https://github.com/leanote/leanote/issues/514
This commit is contained in:
lealife
2017-07-27 15:08:34 +08:00
parent 2654b684df
commit 1ff90dacde

View File

@ -11,6 +11,7 @@ import (
"regexp"
"strings"
"time"
"runtime"
// "github.com/leanote/leanote/app/types"
// "io/ioutil"
"fmt"
@ -463,6 +464,9 @@ func (c Note) ExportPdf(noteId string) revel.Result {
}
cmd := exec.Command("/bin/sh", "-c", cc)
if runtime.GOARCH == "windows" {
cmd = exec.Command("cmd", "/C", cc)
}
_, err := cmd.Output()
if err != nil {
return c.RenderText("export pdf error. " + fmt.Sprintf("%v", err))