-
Notifications
You must be signed in to change notification settings - Fork 73
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: prevent postrun hook from running on uninstalled plugins #805
Conversation
b74f3c2
to
9c2f29c
Compare
3344e24
to
a63f44b
Compare
d44d87e
to
bcba56e
Compare
a63f44b
to
3f2ff19
Compare
b7a9cd8
to
d5f3fbe
Compare
// from this.plugins so that the postrun hook doesn't attempt to run any | ||
// hooks that might have existed in the uninstalled plugins. | ||
if (c.id === 'plugins:uninstall') { | ||
for (const arg of argv) this.plugins.delete(arg) |
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.
plugins uninstall
only accepts 1 arg but I'm guessing argv
could also include --verbose
. this.plugins
is a map and delete
doesn't throw if an element doesn't exist so this seems safe.
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.
Yes but I think plugins uninstall
is supposed to take multiple arguments: https://github.com/oclif/plugin-plugins/blob/main/src/commands/plugins/uninstall.ts#L16
I'm assuming at some point variableArgs = true
was changed to strict = false
but the command was never updated. Iterating over the args now future proofs us from that being fixed eventually
QA notes: repro'd with hardis plugin on latest sf RC.
✅
✅ unlink plugin with postrun hook, no output to stdout:
note: found another bug with the hook generator, see: oclif/oclif#1196 |
Fixes #804
@W-14226831@