-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(commands): add -W
to yarn add
when in yarn workspaces root
#121
fix(commands): add -W
to yarn add
when in yarn workspaces root
#121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HendrikThePendric I think this will throw if package.json
doesn't exist or isn't valid JSON, so if going with this approach it at least needs a try/catch
I did consider that, but thought I would just let the error throw in any case. If there is no package.json or it contains invalid json, this script failing is the least of the repo's worries right? |
It could fail just because it's being run in a directory that doesn't happen to be a package root - in that case it would be much nicer to say "install must be run from the root of an npm package, but no package.json was found" rather than simply an IO failure with a nasty stack trace. |
Technically we should find-up to the nearest package root anyway, rather than assuming the CWD is the root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - suggested a minor update to the message
Co-authored-by: Austin McGee <[email protected]>
-W
to yarn add
when in yarn workspaces root
🎉 This PR is included in version 5.0.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
The command
d2-utils-cypress install
would not complete successfully in a yarn workspaces repo due to the missing-W
flag. This fixes it, but I wonder if there would be a more elegant way to do this...