You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(plugin-workspace-tools): properly report errors for all non-zero exit codes (#6535)
## What's the problem this PR addresses?
`yarn workspaces foreach [...]` does not clearly indicate that there was
a failure, or for what workspace there were non-zero exit codes.
Before: (just says "done", but exit code is 1)
```
Done in 57s 886ms
endo3 on yarn-workspaces-for-scripts [!?] via v18.20.4 took 58s
❯ echo $?
1
```
After:
```
The command failed in workspace ses@workspace:packages/ses
Failed with errors in 45s 837ms
```
## How did you fix it?
I used the `report.reportError` feature to report all the workspaces
that had non-zero exit codes.
The final exitCode is not changed in this PR.
## Checklist
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [x] I have set the packages that need to be released for my changes to
be effective.
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
🙏 @arcanis thank you for yarn 🙏
---------
Co-authored-by: Maël Nison <[email protected]>
report.reportError(MessageName.UNNAMED,`The command failed in workspace ${structUtils.prettyLocator(configuration,workspace.anchoredLocator)} with exit code ${exitCode}`);
431
+
}
432
+
});
429
433
430
-
// The order in which the exit codes will be processed is fairly
431
-
// opaque, so better just return a generic "1" for determinism.
report.reportError(MessageName.UNNAMED,`The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph`);
0 commit comments