From 7d81dada2a2b3ba4c529aa24834bf25ebb354b31 Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Fri, 10 May 2024 15:47:14 +0800 Subject: [PATCH] fix(list): remove extra newline at end of output --- src/cli/list.rs | 6 ++++-- tests/default/list.toml | 1 - tests/list/basic.toml | 1 - tests/list/with_info.toml | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cli/list.rs b/src/cli/list.rs index 2b31368..ce3f3aa 100644 --- a/src/cli/list.rs +++ b/src/cli/list.rs @@ -10,6 +10,10 @@ pub fn handle(package_paths: impl Iterator) -> bool { if let Ok(Ok(package)) = fs::read(&package_path).map(|mut raw| simd_json::from_slice::(&mut raw)) { + if found_package { + println!(); + } + print!("{}", package.make_prefix(None, Stream::Stdout)); found_package = true; @@ -20,8 +24,6 @@ pub fn handle(package_paths: impl Iterator) -> bool { ); println!(" {script_content}"); } - - println!(); } } diff --git a/tests/default/list.toml b/tests/default/list.toml index aab604c..0cb1406 100644 --- a/tests/default/list.toml +++ b/tests/default/list.toml @@ -3,6 +3,5 @@ args = [] stdout = """ dev echo dev - """ stderr = "" diff --git a/tests/list/basic.toml b/tests/list/basic.toml index 25bd6b9..765194c 100644 --- a/tests/list/basic.toml +++ b/tests/list/basic.toml @@ -3,6 +3,5 @@ args = ["list"] stdout = """ dev echo dev - """ stderr = "" diff --git a/tests/list/with_info.toml b/tests/list/with_info.toml index c53e906..78befea 100644 --- a/tests/list/with_info.toml +++ b/tests/list/with_info.toml @@ -4,6 +4,5 @@ stdout = """ @nrr/testing@0.1.0 dev echo dev - """ stderr = ""