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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user