From 33917424a80ffa96b039751c6bb4844137021e8d Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Fri, 22 Nov 2024 20:42:09 +0100 Subject: [PATCH] feat: print no updates available in outdated command --- CHANGELOG.md | 4 ++++ src/cli/commands/outdated.rs | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0aac68c..072167e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/), 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 ### Added - Support fallback Wally registries by @daimond113 diff --git a/src/cli/commands/outdated.rs b/src/cli/commands/outdated.rs index 9d37ece..fa6a227 100644 --- a/src/cli/commands/outdated.rs +++ b/src/cli/commands/outdated.rs @@ -54,7 +54,7 @@ impl OutdatedCommand { let refreshed_sources = Arc::new(Mutex::new(refreshed_sources)); - try_join_all( + if try_join_all( graph .into_iter() .flat_map(|(_, versions)| versions.into_iter()) @@ -63,14 +63,14 @@ impl OutdatedCommand { let refreshed_sources = refreshed_sources.clone(); async move { let Some((alias, mut specifier, _)) = node.node.direct else { - return Ok::<(), anyhow::Error>(()); + return Ok::(true); }; if matches!( specifier, DependencySpecifiers::Git(_) | DependencySpecifiers::Workspace(_) ) { - return Ok(()); + return Ok(true); } let source = node.node.pkg_ref.source(); @@ -116,13 +116,20 @@ impl OutdatedCommand { current_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(()) }