Skip to content

Commit

Permalink
fix: write file to the current folder (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alicia Lopez committed Jun 6, 2020
1 parent ac73304 commit 9dccf82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports.appendFile = function(file, content) {

exports.writeFile = function(file, content) {
const parts = path.parse(file);
if (!fs.existsSync(parts.dir)) {
if (parts.dir !== '' && !fs.existsSync(parts.dir)) {
fs.mkdirSync(parts.dir, { recursive: true });
}
// TODO(joyeecheung): what if the file is a dir?
Expand Down

0 comments on commit 9dccf82

Please sign in to comment.