diff options
Diffstat (limited to 'scripts/style-code.js')
-rw-r--r-- | scripts/style-code.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/style-code.js b/scripts/style-code.js index 70914c5fb6..7e53ebb6be 100644 --- a/scripts/style-code.js +++ b/scripts/style-code.js @@ -30,11 +30,13 @@ global.writeIfModified = function(filename, newContent) { try { const oldContent = fs.readFileSync(filename, 'utf8'); if (oldContent == newContent) { - console.warn(`* Skipping current file '${filename}'`); + console.warn(`* Skipping file '${filename}' because it is up-to-date`); return; } } catch(err) { } - fs.writeFileSync(filename, newContent); + if (['0', 'false'].indexOf(process.env.DRY_RUN || '0') !== -1) { + fs.writeFileSync(filename, newContent); + } console.warn(`* Updating outdated file '${filename}'`); }; |