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

Cannot install crate when using script #725

Closed
xgroleau opened this issue Oct 6, 2022 · 3 comments
Closed

Cannot install crate when using script #725

xgroleau opened this issue Oct 6, 2022 · 3 comments
Assignees
Labels

Comments

@xgroleau
Copy link

xgroleau commented Oct 6, 2022

Describe The Bug

Cannot request to install a crate when using a script instead of a command.

To Reproduce

Result in error:

[tasks.example]
install_crate = "cargo-binutils"
script_runner = "@shell"
script = '''
echo Hello ${@}
'''

Error Stack

 cargo make example World
[cargo-make] INFO - cargo make 0.36.1
[cargo-make] INFO - Build File: Makefile.toml
[cargo-make] INFO - Task: example
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Running Task: legacy-migration
[cargo-make] INFO - Running Task: example
[cargo-make] ERROR - Missing cargo command to invoke.
[cargo-make] WARN - Build Failed.

Current workaround

Passing a argument array with at least one argument works, though the arguments are ignored (which is desired).

[tasks.example]
install_crate = "cargo-binutils"
script_runner = "@shell"
script = '''
echo Hello ${@}
'''
args = ["NeverPrinted"]
@sagiegurari
Copy link
Owner

@xgroleau thanks for reporting this.
its actually a limitation i have at the moment.
let me try to resolve it.

sagiegurari added a commit that referenced this issue Oct 6, 2022
@sagiegurari
Copy link
Owner

@xgroleau this should be supported now in the dev branch 0.36.2
If you can install it and validate that would be great.
the downside of not having a relevant arg is that cargo-make can't validate if that crate is already installed and will always try to install it. it will not provide the force flag so cargo install should just ignore the request.

@xgroleau
Copy link
Author

xgroleau commented Oct 6, 2022

Thanks for the quick response. I can confirm that the dev branch fixes the issue after building locally.

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

No branches or pull requests

2 participants