Skip to content

Commit

Permalink
fix ordering, closes #1135 (#1148)
Browse files Browse the repository at this point in the history
* fix ordering, closes #1135

* add changeset

* don't change the command signature
  • Loading branch information
Schniz authored May 29, 2024
1 parent 41fa05f commit 0b530cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/good-squids-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fnm": patch
---

fix ordering in ls-remote
3 changes: 1 addition & 2 deletions src/commands/ls_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ impl super::command::Command for LsRemote {
}

if self.latest {
all_versions.truncate(1);
all_versions.drain(0..all_versions.len() - 1);
}

all_versions.sort_by_key(|v| v.version.clone());
if let SortingMethod::Descending = self.sort {
all_versions.reverse();
}
Expand Down

0 comments on commit 0b530cc

Please sign in to comment.