From fcb01b91551de9dd08a0cbddaa15d59200dcc574 Mon Sep 17 00:00:00 2001 From: iff Date: Thu, 10 Apr 2025 01:07:44 +0200 Subject: [PATCH] chore: print err if not empty --- core/src/shell.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/shell.rs b/core/src/shell.rs index 7e02a01..247bd31 100644 --- a/core/src/shell.rs +++ b/core/src/shell.rs @@ -353,6 +353,12 @@ pub fn command_output(shell: &str, command: &str) -> String { .output() .expect("failed to execute process"); + let err = String::from_utf8_lossy(&output.stderr); + if !err.is_empty() { + eprintln!("Error while executing command: {}", command); + eprintln!(" {}", err.replace("\n", "\n ")); + } + String::from_utf8_lossy(&output.stdout).to_string() }