@ifaxity/mkdirp
Advanced tools
Comparing version 1.0.0 to 1.0.1
11
main.js
@@ -20,14 +20,13 @@ const { promisify } = require('util'); | ||
return await mkdirp(dirpath, mode); | ||
} | ||
else { | ||
} else { | ||
// In the case of any other error, just see if there's a dir there already. | ||
try { | ||
// Check if something else is borker or if directory already exists | ||
const stat = await stat(dirpath); | ||
if(!stat.isDirectory()) throw ex; | ||
const dirstat = await stat(dirpath); | ||
if(!dirstat.isDirectory()) throw ex; | ||
// Directory exists already yay! report that none was created | ||
return false; | ||
} catch(err) { | ||
// If stat fails then throw it for weirdness | ||
} catch(_) { | ||
// If stat fails then throw first exception it's for weirdness | ||
throw ex; | ||
@@ -34,0 +33,0 @@ } |
{ | ||
"name": "@ifaxity/mkdirp", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A promise based implementation of the bash command mkdir -p", | ||
@@ -5,0 +5,0 @@ "main": "main.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
2368
3
30