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

Let cargo decide when to upgrade #2

Merged
merged 1 commit into from
Apr 9, 2023
Merged

Let cargo decide when to upgrade #2

merged 1 commit into from
Apr 9, 2023

Conversation

phil-opp
Copy link
Owner

@phil-opp phil-opp commented Apr 9, 2023

The cargo install command was not able to update installed binaries 4 years ago. So we needed to use some hacks to detect available updates manually and then use --force to reinstall the newer versions. Apparently this code has some issues with ordering versions numbers, as reported in #1.

While we could use the semver crate to get the correct order, we can also use the "install-update" feature of cargo itself, which was stabilized in Rust 1.41. Using this feature, this PR is able to vastly simlify the crate. We now just parse the cargo install --list output to detect the installed crates and then pass each of them to cargo install. The cargo install command will then figure out whether do upgrade or not itself.

Fixes #1.

@phil-opp phil-opp merged commit 8529a14 into master Apr 9, 2023
@phil-opp phil-opp deleted the fix branch April 9, 2023 14:20
@phil-opp
Copy link
Owner Author

phil-opp commented Apr 9, 2023

Published as v0.1.3

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.

downgrade instead of upgrade
1 participant