PaulDance / cargo-liner

Cargo subcommand to install and update binary packages listed in configuration
https://crates.io/crates/cargo-liner
GNU General Public License v3.0
11 stars 2 forks source link

Allow to pass options to `cargo install` #23

Closed xduugu closed 6 months ago

xduugu commented 9 months ago

Description It is currently not possible to update gitui with cargo-liner, because cargo-liner does not use cargo install's --locked option when installing packages and there is no possibility to set this option without changing the code. Please provide a way to pass options to cargo install to fix this issue.

Preferred solution The easiest solution probably would be to allow setting cargo install options via environment variable. For example, cargo-update use an environment variable CARGO_INSTALL_OPTS for that.

PaulDance commented 9 months ago

Hi!

Yes, this seems appropriate. I'll look into it some time soon.

I already have the plan to add a good part of cargo install's CLI as dedicated configuration options, so that it can be used the easiest. However, having the possibility to pass extra arguments used after all the others would be useful in order to enable users to breach the gap in the meantime.

I therefore see two complementary things that should be done:

PaulDance commented 6 months ago

Hey @xduugu, sorry for the delay! I have now implemented both options in the mentioned commits. Does it work for what you wanted?

You can test it by installing the project with cargo install --git .... I will also publish a new release containing the recent changes in just a few moments.

PaulDance commented 6 months ago

This is now part of v0.7.0. Feel free to open a new issue in case there is something that does not work as expected.

xduugu commented 6 months ago

@PaulDance, thanks a lot! It works as expected.

When testing the new functionality, I noticed that the example configuration in the README is not valid TOML syntax. Apparently, inline tables must not include newlines.

PaulDance commented 6 months ago

It works as expected.

Good!

the example configuration in the README is not valid TOML syntax.

Indeed, I did the change while not even thinking about that. I'll change it to be proper TOML. Thanks for the heads-up :slightly_smiling_face: