Skip to content
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

Is there a way to highlight that a plugin command being installed will conflict #43

Closed
shazron opened this issue May 23, 2018 · 4 comments

Comments

@shazron
Copy link
Contributor

shazron commented May 23, 2018

Repro:

  1. Create a new CLI
  2. Create a new plugin
  3. Add the new plugin to the CLI

At step 3, it doesn't show that the "hello" command conflicts. If it can't be done at install time, perhaps a flag at runtime (verbose?) to show conflicts in the log.

@jdx
Copy link
Contributor

jdx commented May 23, 2018

This is expected behavior. We take advantage of this to allow plugins to be used to override core commands

@jdx jdx closed this as completed May 23, 2018
@shazron
Copy link
Contributor Author

shazron commented May 24, 2018

Mind if I add something to the README via PR that this is the intended behaviour? I didn't see any reference to it in this repo's README or the oclif docs site.

@jdx
Copy link
Contributor

jdx commented May 24, 2018

Sure. To illustrate a bit more:

The Heroku CLI is an oclif CLI made up of many plugins. If we wanted to make a modification to heroku config (for example), we first clone the @heroku-cli/plugin-config repository and run heroku plugins:link to add the development version into the CLI which overrides the existing core plugin.

We might also work on a replacement command like heroku addons:create in a new plugin that defines heroku addons:create even though this is already defined by a different core plugin built into the CLI.

The loading order is core < user (plugins:install) < linked (plugins:link). In other words, a user plugin overrides a core plugin and a linked plugin overrides a user plugin. If it worked the other way (say, core before linked) it would be impossible to make modifications to an existing core plugin.

There are a few other similar situations where this behavior is ideal.

@shazron
Copy link
Contributor Author

shazron commented May 24, 2018

Gotcha! Thanks, especially for the core < user (plugins:install) < linked (plugins:link) explanation, makes sense now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants