feat: print no updates available in outdated command

This commit is contained in:
daimond113 2024-11-22 20:42:09 +01:00
parent 9268159dc6
commit 33917424a8
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C
2 changed files with 16 additions and 5 deletions

View file

@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Print that no updates are available in `outdated` command by @daimond113
## [0.5.0-rc.12] - 2024-11-22 ## [0.5.0-rc.12] - 2024-11-22
### Added ### Added
- Support fallback Wally registries by @daimond113 - Support fallback Wally registries by @daimond113

View file

@ -54,7 +54,7 @@ impl OutdatedCommand {
let refreshed_sources = Arc::new(Mutex::new(refreshed_sources)); let refreshed_sources = Arc::new(Mutex::new(refreshed_sources));
try_join_all( if try_join_all(
graph graph
.into_iter() .into_iter()
.flat_map(|(_, versions)| versions.into_iter()) .flat_map(|(_, versions)| versions.into_iter())
@ -63,14 +63,14 @@ impl OutdatedCommand {
let refreshed_sources = refreshed_sources.clone(); let refreshed_sources = refreshed_sources.clone();
async move { async move {
let Some((alias, mut specifier, _)) = node.node.direct else { let Some((alias, mut specifier, _)) = node.node.direct else {
return Ok::<(), anyhow::Error>(()); return Ok::<bool, anyhow::Error>(true);
}; };
if matches!( if matches!(
specifier, specifier,
DependencySpecifiers::Git(_) | DependencySpecifiers::Workspace(_) DependencySpecifiers::Git(_) | DependencySpecifiers::Workspace(_)
) { ) {
return Ok(()); return Ok(true);
} }
let source = node.node.pkg_ref.source(); let source = node.node.pkg_ref.source();
@ -116,13 +116,20 @@ impl OutdatedCommand {
current_version_id.version(), current_version_id.version(),
version_id.version() version_id.version()
); );
return Ok(false);
} }
Ok(()) Ok(true)
} }
}), }),
) )
.await?; .await?
.into_iter()
.all(|b| b)
{
println!("all packages are up to date");
}
Ok(()) Ok(())
} }