summaryrefslogtreecommitdiff
path: root/scripts/style-code.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/style-code.js')
-rw-r--r--scripts/style-code.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/style-code.js b/scripts/style-code.js
index 7e53ebb6be..7a93b13a77 100644
--- a/scripts/style-code.js
+++ b/scripts/style-code.js
@@ -1,6 +1,7 @@
// Global functions //
const fs = require('fs');
+const path = require('path');
global.iff = function (condition, val) {
return condition() ? val : "";
@@ -26,7 +27,15 @@ global.unhyphenate = function (str) {
return str.replace(/-/g, " ");
};
+// Write out a list of files that this script is modifying so that we can check
+var files = [];
+process.on('exit', function() {
+ const list = path.join(path.dirname(process.argv[1]), path.basename(process.argv[1], '.js') + '.list');
+ fs.writeFileSync(list, files.join('\n'));
+});
+
global.writeIfModified = function(filename, newContent) {
+ files.push(filename);
try {
const oldContent = fs.readFileSync(filename, 'utf8');
if (oldContent == newContent) {