Skip to content

Commit

Permalink
fix(aura): print -Bl and -Cl output in alphabetical order
Browse files Browse the repository at this point in the history
Fixes #893
  • Loading branch information
fosskers committed Aug 9, 2024
1 parent e107cbf commit d9241c2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- `check`: confirm that `dot` is on the system. If missing, it belongs to the `graphviz` package.
- `--noconfirm` now affects all prompts.
- `-Sw` no longer requires arguments. This reenables `-Syuw`.
- `-Bl` and `-Cl` now print paths in alphabetical order.

## 4.0.1

Expand Down
21 changes: 16 additions & 5 deletions rust/aura-pm/src/command/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,22 @@ pub(crate) fn invalid(

/// Print the contents of the package caches.
pub(crate) fn list(caches: &[&Path]) -> Result<(), Error> {
for path in caches {
path.read_dir()
.map_err(|_| Error::ReadDir(path.to_path_buf()))?
.filter_map(|de| de.ok())
.for_each(|de| println!("{}", de.path().display()));
let rds = caches
.iter()
.map(|path| {
path.read_dir()
.map_err(|_| Error::ReadDir(path.to_path_buf()))
})
.collect::<Result<Vec<_>, Error>>()?;

let mut paths: Vec<_> = rds
.into_iter()
.flat_map(|rd| rd.filter_map(|de| de.ok()).map(|de| de.path()))
.collect();
paths.sort();

for path in paths {
println!("{}", path.display());
}

Ok(())
Expand Down
7 changes: 6 additions & 1 deletion rust/aura-pm/src/command/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ pub(crate) fn clean(fll: &FluentLanguageLoader, env: &Env) -> Result<(), Error>

/// Show all saved package snapshot filenames.
pub(crate) fn list(snapshots: &Path) -> Result<(), Error> {
for (path, _) in aura_core::snapshot::snapshots_with_paths(snapshots) {
let mut paths: Vec<_> = aura_core::snapshot::snapshots_with_paths(snapshots)
.map(|(path, _)| path)
.collect();
paths.sort();

for path in paths {
println!("{}", path.display());
}

Expand Down

0 comments on commit d9241c2

Please sign in to comment.