1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 04:52:26 -05:00

fix(outdated): Use latest tag even when it's the same as the current version (#27699)

Fixes https://github.com/denoland/deno/issues/27696.

Just a `>` that should've been a `>=`. Also made sure to filter out
deprecated versions.
This commit is contained in:
Nathan Whitaker 2025-01-16 12:03:25 -08:00 committed by GitHub
parent 256950ddb6
commit a5ba198b9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 2 deletions

View file

@ -683,10 +683,21 @@ impl DepManager {
.and_then(|info| {
let latest_tag = info.dist_tags.get("latest")?;
let lower_bound = &semver_compatible.as_ref()?.version;
if latest_tag > lower_bound {
if latest_tag >= lower_bound {
Some(latest_tag.clone())
} else {
latest_version(Some(latest_tag), info.versions.keys())
latest_version(
Some(latest_tag),
info.versions.iter().filter_map(
|(version, version_info)| {
if version_info.deprecated.is_none() {
Some(version)
} else {
None
}
},
),
)
}
})
.map(|version| PackageNv {

View file

@ -0,0 +1,13 @@
{
"tempDir": true,
"steps": [
{
"args": "install",
"output": "[WILDCARD]"
},
{
"args": "outdated",
"output": ""
}
]
}

View file

@ -0,0 +1,5 @@
{
"dependencies": {
"@denotest/has-pre-release": "1.0.0"
}
}