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

Add cli overrides #70

Closed
wants to merge 4 commits into from
Closed

Conversation

Darunada
Copy link
Contributor

@Darunada Darunada commented Oct 31, 2021

fixes #69

This adds support for overriding pkg-url, bin-path, and pkg-format using cli arguments of the same name.

For example, to install Just, which doesn't follow the standard format:

cargo binstall --pkg-url="{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.{ format }" --pkg-fmt="tar.gz" --bin-path="{name}" --target=x86_64-unknown-linux-musl just

I also applied a couple of clippy recommendations and added support for tar.gz

@ryankurte
Copy link
Collaborator

ryankurte commented Oct 31, 2021

howdy, thanks for the PR, seems like a reasonable improvement!

the other thing i had thought might be useful for this case is to perform the crate lookup, find the repository, then to hit the GH API to scrape the repository for binaries associated with the version from the cargo file (which would lead to supporting installation from github URLs and versions too).

FYI we'll probably try to change the names of these fields in a backwards-compatible-for-metadata way in the near future but the CLI args might change names to match.

@Darunada
Copy link
Contributor Author

Darunada commented Oct 31, 2021

Thanks! Using the github api seems like a no-fuss method of doing it. This method would allow downloading from hypothetically any location using the correct url template, which I thought was interesting.

I am happy to change the names of the params to whatever you think might be appropriate before merging.

@passcod
Copy link
Member

passcod commented Nov 22, 2021

(Hi! I'm a new maintainer 👋🏻)

Could you split the "support for targz" away? Tar + Gzip is already supported (I think there should be a better way to deal with .tar.gz == .tgz and .tar.xz == .txz etc, but probably not by adding redundant variants).

@passcod passcod mentioned this pull request May 31, 2022
@passcod
Copy link
Member

passcod commented May 31, 2022

Superseded by #147

@passcod passcod closed this May 31, 2022
passcod added a commit that referenced this pull request May 31, 2022
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

Successfully merging this pull request may close these issues.

Allow downloading unsupported packages by overriding the templates at run time
3 participants