mirror of
https://github.com/electron/electron.git
synced 2026-10-28 11:44:46 +08:00
build: fail patch diff check on subprocess errors (#52392)
This commit is contained in:
1 parent
0c5e210d3c
commit
40c2abea87
1 file changed
+14
-3
@@ -10,8 +10,19 @@ const proc = spawnSync('python3', [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'));
|
||||
if (proc.error) {
|
||||
console.error(proc.error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (proc.signal) {
|
||||
console.error(`Patch export terminated by signal ${proc.signal}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Fail if patch exporting failed, e.g. dry run found changes.
|
||||
if (proc.status !== 0) {
|
||||
console.log(proc.stdout.toString('utf8'));
|
||||
console.error(proc.stderr.toString('utf8'));
|
||||
process.exit(proc.status ?? 1);
|
||||
}
|
||||
Reference in new issue
Block a user