summaryrefslogtreecommitdiff
path: root/scripts/style-code.js
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-01-10 16:04:06 -0800
committerKonstantin Käfer <mail@kkaefer.com>2018-01-24 08:35:31 -0800
commit13d27c700e4b0590c4f1c365bfa36cf2a07c437d (patch)
treecade6aa820a3f516963e2c01c16d3e91b32a6b43 /scripts/style-code.js
parent9d1fa508a34f013573294794028f4ffa5a5f5f3d (diff)
downloadqtlocation-mapboxgl-13d27c700e4b0590c4f1c365bfa36cf2a07c437d.tar.gz
[build] Always use style-code's writeIfModified to unify file updates
Diffstat (limited to 'scripts/style-code.js')
-rw-r--r--scripts/style-code.js6
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}'`);
};