Skip to content

Commit

Permalink
Disallow empty files on pull (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirazul authored and grant committed Feb 2, 2018
1 parent dd1ae46 commit acd4dde
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ function fetchProject(scriptId, rootDir) {
let truePath = `${rootDir || '.'}/${filePath}`;
mkdirp(path.dirname(truePath), (err) => {
if (err) return logError(err, ERROR.FS_DIR_WRITE);
if (!file.source) return;
fs.writeFile(truePath, file.source, (err) => {
if (err) return logError(err, ERROR.FS_FILE_WRITE);
});
Expand Down

0 comments on commit acd4dde

Please sign in to comment.