Skip to content

Let cargo decide when to upgrade#2

Merged
phil-opp merged 1 commit intomasterfrom
fix
Apr 9, 2023
Merged

Let cargo decide when to upgrade#2
phil-opp merged 1 commit intomasterfrom
fix

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