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

Support not running installers if a package is already present #66

Open
ibarakaiev opened this issue Aug 3, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@ibarakaiev
Copy link
Contributor

Describe the bug
Right now, if a package is already installed, Igniter outputs that the dependency is already in mix.exs but proceeds to run the installer:

Dependency ash_postgres is already in mix.exs with the desired version. Skipping.

The following installer was found and executed: `ash_postgres.install`:

    No proposed content changes!

The following tasks will be run

* ash.codegen initialize

To Reproduce
Run mix igniter.install ash_postgres twice.

Expected behavior
To avoid inconsistency (i.e. saying "skipping" then proceeding to install), if a package is already installed, I'd suggest either:

  • Skipping the installation as well by default, but supporting a flag like to run the installer anyway even if present.
  • Avoid saying "Skipping" by default, always running the installer, but support --skip-if-present which would skip the installer if passed.
@ibarakaiev ibarakaiev added the bug Something isn't working label Aug 3, 2024
@zachdaniel
Copy link
Contributor

🤔 we could make it interactive like "Dependency ash_postgres is already in mix.exs, would you like to rerun the installer"?

@ibarakaiev
Copy link
Contributor Author

That's a great idea from the DX perspective—doesn't require remembering what flag to use. I wonder what should the behavior be when --yes is passed in this case, though 🤔 Would probably still require a flag to overwrite it in case the end user wants to auto-accept everything but not run installers unless a new package is being added (that's the use case in Fireside, for example).

@zachdaniel
Copy link
Contributor

--yes should automatically reply yes to any questions. The implication behind it is that it makes igniter scriptable. I.e "yes I know what this command will do and I want you to do it". So we could add a flag like you mentioned that makes it not ask, assuming false. Like --skip-installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants