LibreOffice: Use consistent intermediate filename

pull/4960/head
Richard Hansen 2021-03-18 00:13:38 -04:00 committed by John McLear
parent ad0be9d1d2
commit a6d5611c80
1 changed files with 3 additions and 2 deletions

View File

@ -109,15 +109,16 @@ exports.convertFile = (srcFile, destFile, type, callback) => {
// we need to convert to odt first, then to doc // we need to convert to odt first, then to doc
// to avoid `Error: no export filter for /tmp/xxxx.doc` error // to avoid `Error: no export filter for /tmp/xxxx.doc` error
if (type === 'doc') { if (type === 'doc') {
const intermediateFile = destFile.replace(/\.doc$/, '.odt');
queue.push({ queue.push({
srcFile, srcFile,
destFile: destFile.replace(/\.doc$/, '.odt'), destFile: intermediateFile,
type: 'odt', type: 'odt',
fileExtension: 'odt', fileExtension: 'odt',
callback: () => { callback: () => {
queue.push( queue.push(
{ {
srcFile: srcFile.replace(/\.html$/, '.odt'), srcFile: intermediateFile,
destFile, destFile,
type, type,
callback, callback,