Write out change CLI changes synchronously. Fixes #1287. (#1292)

master
John Resig 2017-04-15 17:06:20 -04:00 committed by Christopher Chedeau
parent 8ba3fc8623
commit 793db3150a
1 changed files with 7 additions and 7 deletions

View File

@ -268,13 +268,13 @@ if (stdin) {
} else {
console.log("%s %dms", filename, Date.now() - start);
fs.writeFile(filename, output, "utf8", err => {
if (err) {
console.error("Unable to write file: " + filename + "\n" + err);
// Don't exit the process if one file failed
process.exitCode = 2;
}
});
try {
fs.writeFileSync(filename, output, "utf8");
} catch (err) {
console.error("Unable to write file: " + filename + "\n" + err);
// Don't exit the process if one file failed
process.exitCode = 2;
}
}
} else if (argv["debug-check"]) {
process.stdout.write("\n");