check-patch-diff.ts 598 B

1234567891011121314151617
  1. import { spawnSync } from 'child_process';
  2. import * as path from 'path';
  3. const srcPath = path.resolve(__dirname, '..', '..', '..');
  4. const patchExportFnPath = path.resolve(__dirname, 'export_all_patches.py');
  5. const configPath = path.resolve(__dirname, '..', 'patches', 'config.json');
  6. // Re-export all the patches to check if there were changes.
  7. const proc = spawnSync('python', [patchExportFnPath, configPath, '--dry-run'], {
  8. cwd: srcPath
  9. });
  10. // Fail if patch exporting returned 1, e.g dry run failed.
  11. if (proc.status === 1) {
  12. console.log(proc.stderr.toString('utf8'));
  13. process.exit(1);
  14. }