mirror of https://github.com/mindoc-org/mindoc.git
parent
26ee92c92b
commit
5f64530ccf
|
@ -458,15 +458,15 @@ func (this *Converter) convertToEpub() (err error) {
|
|||
filepath.Join(this.OutputPath, "content.epub"),
|
||||
filepath.Join(this.OutputPath, output, "book.epub"),
|
||||
}
|
||||
cmd := exec.Command(ebookConvert, args...)
|
||||
//cmd := exec.Command(ebookConvert, args...)
|
||||
//
|
||||
//if this.Debug {
|
||||
// fmt.Println(cmd.Args)
|
||||
//}
|
||||
//fmt.Println("正在转换EPUB文件", args[0])
|
||||
//return cmd.Run()
|
||||
|
||||
if this.Debug {
|
||||
fmt.Println(cmd.Args)
|
||||
}
|
||||
fmt.Println("正在转换EPUB文件", args[0])
|
||||
return cmd.Run()
|
||||
|
||||
//return filetil.CopyFile(filepath.Join(this.OutputPath, "content.epub"),filepath.Join(this.OutputPath, output, "book.epub"))
|
||||
return filetil.CopyFile(args[0],args[1])
|
||||
}
|
||||
|
||||
//转成mobi
|
||||
|
|
|
@ -232,9 +232,7 @@ func (m *BookResult) Converter(sessionId string) (ConvertBookResult, error) {
|
|||
beego.Error("创建目录失败 => ",tempOutputPath,err)
|
||||
}
|
||||
|
||||
defer func(p string) {
|
||||
os.RemoveAll(p)
|
||||
}(tempOutputPath)
|
||||
defer os.RemoveAll(strings.TrimSuffix(tempOutputPath,"source"))
|
||||
|
||||
if filetil.FileExists(pdfpath) && filetil.FileExists(epubpath) && filetil.FileExists(mobipath) && filetil.FileExists(docxpath) {
|
||||
convertBookResult.EpubPath = epubpath
|
||||
|
|
Loading…
Reference in New Issue