Skip to content

Commit b8fe8c2

Browse files
Brian Vaughnzhengjitf
authored andcommitted
Yarn replace-fork should not silently error (facebook#22156)
1 parent e007e6a commit b8fe8c2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/merge-fork/replace-fork.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ async function main() {
2222
await Promise.all(oldFilenames.map(unforkFile));
2323

2424
// Use ESLint to autofix imports
25-
spawnSync('yarn', ['linc', '--fix']);
25+
const spawn = spawnSync('yarn', ['linc', '--fix'], {
26+
stdio: ['inherit', 'inherit', 'pipe'],
27+
});
28+
if (spawn.stderr.toString() !== '') {
29+
spawnSync('git', ['checkout', '.']);
30+
31+
console.log(Error(spawn.stderr));
32+
process.exitCode = 1;
33+
}
2634
}
2735

2836
async function unforkFile(oldFilename) {

0 commit comments

Comments
 (0)