From 73d09f1c6cd10b6eb1a62ae14477feb2ebb7fc10 Mon Sep 17 00:00:00 2001 From: muxator Date: Wed, 31 Oct 2018 22:34:11 +0100 Subject: [PATCH] LibreOffice: rephrase comments (conversion is generic and not PDF-specific) --- src/node/utils/LibreOffice.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/node/utils/LibreOffice.js b/src/node/utils/LibreOffice.js index 6f049d224..7c1289856 100644 --- a/src/node/utils/LibreOffice.js +++ b/src/node/utils/LibreOffice.js @@ -56,7 +56,10 @@ function doConvertTask(task, callback) { var tmpDir = os.tmpdir(); async.series([ - // Generate a PDF file with LibreOffice + /* + * use LibreOffice to convert task.srcFile to another format, given in + * task.type + */ function(callback) { var soffice = spawn(settings.soffice, [ '--headless', @@ -81,17 +84,18 @@ function doConvertTask(task, callback) { stdoutBuffer += data.toString(); }); - // Throw an exception if libreoffice failed soffice.on('exit', function(code) { if (code != 0) { + // Throw an exception if libreoffice failed return callback(`LibreOffice died with exit code ${code} and message: ${stdoutBuffer}`); } + // if LibreOffice exited succesfully, go on with processing callback(); }) }, - // Move the PDF file to the correct place + // Move the converted file to the correct place function(callback) { var filename = path.basename(task.srcFile); var pdfFilename = filename.substr(0, filename.lastIndexOf('.')) + '.' + task.type;