diff --git a/src/shell.rs b/src/shell.rs index 36b0982..959885d 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -235,7 +235,10 @@ pub fn command_output(shell: &str, command: &str) -> String { .output() .expect("failed to execute process"); - String::from_utf8_lossy(&output.stdout).to_string() + match output.stdout.is_empty() { + false => String::from_utf8_lossy(&output.stdout).to_lowercase(), + true => String::from_utf8_lossy(&output.stderr).to_lowercase(), + } } pub fn last_command(shell: &str) -> String {