Skip to content

Commit

Permalink
Make sure dir exists when stat'ing
Browse files Browse the repository at this point in the history
Otherwise an exception is thrown and things fail on an npm run init

Auditors: @bridiver
  • Loading branch information
bbondy committed Sep 8, 2018
1 parent ac51cfb commit 05a6963
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const util = {
for (var i in sourceFiles) {
const sourceFile = sourceFiles[i]
let destinationFile = output
if (fs.statSync(destinationFile).isDirectory()) {
if (fs.existsSync(destinationFile) && fs.statSync(destinationFile).isDirectory()) {
destinationFile = path.join(destinationFile, path.basename(sourceFile))
}

Expand Down

0 comments on commit 05a6963

Please sign in to comment.