build: check patches on update (#23103)
This commit is contained in:
parent
a1c55a13e1
commit
9d960e29eb
4 changed files with 56 additions and 15 deletions
18
script/check-patch-diff.js
Normal file
18
script/check-patch-diff.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
const { spawnSync } = require('child_process');
|
||||
const path = require('path');
|
||||
const { inspect } = require('util');
|
||||
|
||||
const srcPath = path.resolve(__dirname, '..', '..', '..');
|
||||
const patchExportFnPath = path.resolve(__dirname, 'export_all_patches.py');
|
||||
const configPath = path.resolve(__dirname, '..', 'patches', 'config.json');
|
||||
|
||||
// Re-export all the patches to check if there were changes.
|
||||
const proc = spawnSync('python', [patchExportFnPath, configPath, '--dry-run'], {
|
||||
cwd: srcPath
|
||||
});
|
||||
|
||||
// Fail if patch exporting returned 1, e.g dry run failed.
|
||||
if (proc.status === 1) {
|
||||
console.log(proc.stderr.toString('utf8'));
|
||||
process.exit(1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue