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:
parent
256950ddb6
commit
a5ba198b9a
3 changed files with 31 additions and 2 deletions
|
@ -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 {
|
||||
|
|
13
tests/specs/update/latest_not_pre_release/__test__.jsonc
Normal file
13
tests/specs/update/latest_not_pre_release/__test__.jsonc
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"tempDir": true,
|
||||
"steps": [
|
||||
{
|
||||
"args": "install",
|
||||
"output": "[WILDCARD]"
|
||||
},
|
||||
{
|
||||
"args": "outdated",
|
||||
"output": ""
|
||||
}
|
||||
]
|
||||
}
|
5
tests/specs/update/latest_not_pre_release/package.json
Normal file
5
tests/specs/update/latest_not_pre_release/package.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"@denotest/has-pre-release": "1.0.0"
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue