mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-13 23:03:55 +01:00
fix: use stderr if stdout is empty
This commit is contained in:
parent
21ded71ab6
commit
f14a1c1ea7
1 changed files with 4 additions and 1 deletions
|
|
@ -235,7 +235,10 @@ pub fn command_output(shell: &str, command: &str) -> String {
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to execute process");
|
.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 {
|
pub fn last_command(shell: &str) -> String {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue