Platform flattening overhaul (#1393)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
mwilsnd
2023-07-26 10:50:34 -05:00
committed by GitHub
parent 1145d0079b
commit 20d9e1028c
932 changed files with 5445 additions and 11714 deletions

View File

@@ -35,7 +35,16 @@ process.on('exit', function() {
fs.writeFileSync(list, files.join("\n"));
});
global.writeIfModified = function(filename, newContent) {
global.writeIfModified = function(filename, newContent, output) {
if (output) {
filename = path.resolve(path.join(output, filename));
}
const info = path.parse(filename);
if (!fs.existsSync(info.dir)) {
fs.mkdirSync(info.dir, {recursive: true});
}
files.push(filename);
try {
const oldContent = fs.readFileSync(filename, 'utf8');