parent
3f776bed3d
commit
17add13860
|
@ -191,6 +191,9 @@ if (stdin) {
|
|||
}
|
||||
|
||||
if (write) {
|
||||
// Don't write the file if it won't change in order not to invalidate
|
||||
// mtime based caches.
|
||||
if (output !== input) {
|
||||
fs.writeFile(filename, output, "utf8", err => {
|
||||
if (err) {
|
||||
console.error("Unable to write file: " + filename + "\n" + err);
|
||||
|
@ -198,6 +201,7 @@ if (stdin) {
|
|||
process.exitCode = 2;
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Don't use `console.log` here since it adds an extra newline at the end.
|
||||
process.stdout.write(output);
|
||||
|
|
Loading…
Reference in New Issue