mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
build: export matching patches (#41287)
* build: make patches/config.json an array of objects This file was previously an object of patch_dir keys to repo values; Now is an array of objects containing `patch_dir` and `repo` properties. This makes other per-target properties (e.g. `grep`) possible. Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: include Note metadata when exporting patches Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: support keyword filtering in export_patches() Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: add optional `--grep` arg to git-export-patches script Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: update export_all_patches to understand new config file Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! build: update export_all_patches to understand new config file chore: make lint happy Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! build: make patches/config.json an array of objects chore: fix oops Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: remove support for the old file format There is more code using config.json than I thought, so the effort-to-reward of supporting the old format is not worth it. Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: update apply_all_patches to understand new config file Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: update lint.js to understand new config file Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: update patches-mtime-cache.py to understand new config file Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! build: update apply_all_patches to understand new config file fix: oops Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! build: update apply_all_patches to understand new config file fix minor syntax wart Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! build: support keyword filtering in export_patches() refactor: use idiomatic python Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: warn if config.json has an invalid repo Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
@@ -201,10 +201,9 @@ const LINTERS = [{
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const config = JSON.parse(fs.readFileSync(patchesConfig, 'utf8'));
|
||||
for (const key of Object.keys(config)) {
|
||||
for (const target of JSON.parse(fs.readFileSync(patchesConfig, 'utf8'))) {
|
||||
// The directory the config points to should exist
|
||||
const targetPatchesDir = path.resolve(__dirname, '../../..', key);
|
||||
const targetPatchesDir = path.resolve(__dirname, '../../..', target.patch_dir);
|
||||
if (!fs.existsSync(targetPatchesDir)) {
|
||||
console.error(`target patch directory: "${targetPatchesDir}" does not exist`);
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user