nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

Update to newer prerelease #265

Closed woelfman closed 2 months ago

woelfman commented 2 months ago

If an installed package is a prerelease, a compatible prerelease update should be applied.

For example, I have:

Package             Installed    Latest                            Needs update
tauri-cli           v2.0.0-rc.1  v1.6.0 (v2.0.0-rc.3 available)    No

If I were on v1.6.0, then no action should be taken, but since I'm on v2.0.0-rc.1 the update to v2.0.0-rc.3 should be applied.

Once the update is applied, the rc does not need to be listed as available. The present behavior is shown below, which leads one to believe that there's some action that could be taken, which isn't true:

tauri-cli           v2.0.0-rc.3  v1.6.0 (v2.0.0-rc.3 available)    No
nabijaczleweli commented 2 months ago

Good idea, implemented exactly as-described (a prerelease is considered installable IF --install-prereleases OR (current.majminpatch == candidate.majminpatch)).

>target\debug\cargo-install-update install-update -l tauri-cli
    Polling registry 'https://index.crates.io/'.

Package    Installed    Latest                          Needs update
tauri-cli  v1.0.0-rc.1  v1.6.0 (v2.0.0-rc.3 available)  Yes

>target\debug\cargo-install-update install-update -l tauri-cli
    Polling registry 'https://index.crates.io/'.

Package    Installed    Latest       Needs update
tauri-cli  v2.0.0-rc.1  v2.0.0-rc.3  Yes

>target\debug\cargo-install-update install-update -l tauri-cli
    Polling registry 'https://index.crates.io/'.

Package    Installed    Latest       Needs update
tauri-cli  v2.0.0-rc.3  v2.0.0-rc.3  No
nabijaczleweli commented 2 months ago

Released in v14.0.0