Comparing version 1.1.2 to 1.1.3
const fs = require('fs'); | ||
const util = require('util'); | ||
const path = require('path'); | ||
@@ -7,2 +8,4 @@ const temp = require('temp-dir'); | ||
const stat = util.promisify(fs.lstat); | ||
shortid.characters('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_@'); | ||
@@ -64,2 +67,19 @@ | ||
async function exists(source) { | ||
const file = await outcome(stat(source)); | ||
if (file.success && file.result.isFile()) { | ||
return true; | ||
} | ||
if (file.success && !file.result.isFile()) { | ||
return false; | ||
} | ||
if (!file.success && file.error.code === 'ENOENT') { | ||
return false; | ||
} | ||
} | ||
function status() { | ||
@@ -93,8 +113,6 @@ return { | ||
if (source === preview) { | ||
preview = `${options.destination}/${target.name}${Array.from(shortid.generate()).slice(0, 9).join('')}.jpg`; | ||
if (await exists(preview)) { | ||
preview = `${options.destination}/${target.name}-${Array.from(shortid.generate()).slice(0, 9).join('')}.jpg`; | ||
} | ||
await outcome(remove(preview)); | ||
if (!master.exiftool && (!exiftool && !options.persist)) { | ||
@@ -101,0 +119,0 @@ exiftool = new ExifTool({ |
{ | ||
"name": "extractd", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Extract previews from DSLR and mirrorless cameras' RAW files", | ||
@@ -5,0 +5,0 @@ "main": "extractd.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28932
483