增加更多的输出日志

pull/257/head v0.10.1
Minho 2018-04-03 13:03:47 +08:00
parent 26ee92c92b
commit 5f64530ccf
2 changed files with 9 additions and 11 deletions

View File

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

View File

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