Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanZim committed Feb 14, 2020
1 parent d65f9f5 commit 51938c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/mkdirs/make-dir.js
Expand Up @@ -79,8 +79,12 @@ module.exports.makeDir = async (input, options) => {
return make(pth)
}

const stats = await fs.stat(pth)
if (!stats.isDirectory()) {
try {
const stats = await fs.stat(pth)
if (!stats.isDirectory()) {
throw new Error('The path is not a directory')
}
} catch {
throw error
}
}
Expand Down

0 comments on commit 51938c2

Please sign in to comment.