pdf-powerpoint
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -323,7 +323,8 @@ 'use strict' | ||
fs.stat(stagingDir, (err, s) => { | ||
if (err || !s.exists()) { | ||
if (err || !s.isDirectory()) { | ||
pdfLogger(this.options.jobId, 'staging directory:', stagingDir, 'does not exist, creating a new one') | ||
return this._createTempStagingDirectory() | ||
} else { | ||
this._createImageDirectory(stagingDir, reject, resolve) | ||
} | ||
resolve(stagingDir) | ||
}) | ||
@@ -338,8 +339,5 @@ } else { | ||
return new Promise((resolve, reject) => { | ||
fs.mkdtemp(`${os.tmpdir()}/pdf_ppt_`, (err, folder) => { | ||
fs.mkdtemp(path.join(os.tmpdir(), 'pdf_ppt_'), (err, folder) => { | ||
if (err) reject(err) | ||
fs.mkdir(path.resolve(folder, 'img'), (err) => { | ||
if (err) reject(err) | ||
resolve(folder) | ||
}) | ||
this._createImageDirectory(folder, reject, resolve) | ||
}) | ||
@@ -349,2 +347,9 @@ }) | ||
_createImageDirectory (folder, reject, resolve) { | ||
fs.mkdir(path.resolve(folder, 'img'), (err) => { | ||
if (err) reject(err) | ||
resolve(folder) | ||
}) | ||
} | ||
nowInMillis () { | ||
@@ -351,0 +356,0 @@ return Date.now() // process.hrtime()[1] / 1000000 |
{ | ||
"name": "pdf-powerpoint", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Converts one or more PDFs into a powerpoint with one pdf page per slide", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
106258
399