mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 06:20:09 +01:00
feat: error from env
This commit is contained in:
parent
e1b45ebf98
commit
fe083a9ddb
1 changed files with 9 additions and 1 deletions
10
src/modes.rs
10
src/modes.rs
|
|
@ -8,7 +8,15 @@ pub fn suggestion() {
|
|||
let shell = get_shell();
|
||||
let mut last_command = shell::last_command(&shell).trim().to_string();
|
||||
last_command = shell::expand_alias(&shell, &last_command);
|
||||
let mut error_msg = command_output(&shell, &last_command);
|
||||
let mut error_msg = {
|
||||
let error_msg = std::env::var("_PR_ERROR_MSG");
|
||||
if let Ok(error_msg) = error_msg {
|
||||
error_msg
|
||||
} else {
|
||||
command_output(&shell, &last_command)
|
||||
}
|
||||
};
|
||||
|
||||
error_msg = error_msg
|
||||
.split_whitespace()
|
||||
.collect::<Vec<&str>>()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue