fix: don't execute styled command

This commit is contained in:
iff 2023-08-07 17:03:48 +02:00
parent 73ad099b34
commit 77b0793076
2 changed files with 2 additions and 4 deletions

View file

@ -18,8 +18,8 @@ fn main() {
if let Some(corrected_command) = corrected_command {
let command_difference = highlight_difference(&shell, &corrected_command, &last_command);
if let Some(command) = command_difference {
suggestions::confirm_suggestion(&shell, &command);
if let Some(highlighted_command) = command_difference {
suggestions::confirm_suggestion(&shell, &corrected_command, &highlighted_command);
return;
}
}

View file

@ -7,8 +7,6 @@ use colored::*;
pub fn highlight_difference(shell: &str, suggested_command: &str, last_command: &str) -> Option<String> {
let mut split_suggested_command = split_command(suggested_command);
let split_last_command = split_command(last_command);
println!("split_suggested_command: {:?}", split_suggested_command);
println!("split_last_command: {:?}", split_last_command);
if split_suggested_command == split_last_command {
return None;