mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 22:40:09 +01:00
rewrite: removed unneeded operations
This commit is contained in:
parent
10a23a7e09
commit
18f5627587
1 changed files with 2 additions and 3 deletions
|
|
@ -23,9 +23,8 @@ fn last_command(shell: &str) -> String {
|
|||
let last_command = std::env::var("_PR_LAST_COMMAND").expect("No _PR_LAST_COMMAND in environment. Did you aliased the command with the correct argument?");
|
||||
match shell {
|
||||
"bash" => {
|
||||
let first_line = last_command.lines().next().unwrap();
|
||||
let split = first_line.split_whitespace().collect::<Vec<&str>>();
|
||||
split[1..].join(" ")
|
||||
let first_line = last_command.lines().next().unwrap().trim();
|
||||
first_line.split_once(" ").unwrap().1.to_string()
|
||||
}
|
||||
"zsh" => last_command,
|
||||
"fish" => last_command,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue