mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 06:20:09 +01:00
fix: broken rules for new nushell version
This commit is contained in:
parent
8f9aac6bdc
commit
a71486e956
3 changed files with 8 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ pattern = [
|
|||
]
|
||||
suggest = [
|
||||
'''
|
||||
#[!shell(nu)]
|
||||
mkdir --parents {{command[1]}} && \
|
||||
cd {{command[1]}} '''
|
||||
]
|
||||
|
|
@ -17,5 +18,6 @@ pattern = [
|
|||
]
|
||||
suggest = [
|
||||
'''
|
||||
mkdir {{command[1]}} '''
|
||||
mkdir {{command[1]}} and \
|
||||
cd {{command[1]}} '''
|
||||
]
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ fn eval_condition(
|
|||
"min_length" => split_command.len() >= arg.parse::<usize>().unwrap(),
|
||||
"length" => split_command.len() == arg.parse::<usize>().unwrap(),
|
||||
"max_length" => split_command.len() <= arg.parse::<usize>().unwrap() + 1,
|
||||
"shell" => shell == arg,
|
||||
_ => unreachable!("Unknown condition when evaluation condition: {}", condition),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,9 +249,11 @@ end
|
|||
|
||||
pub fn shell_syntax(shell: &str, command: &mut String) {
|
||||
#[allow(clippy::single_match)]
|
||||
eprintln!("command: {}", command);
|
||||
match shell {
|
||||
"nushell" => {
|
||||
"nu" => {
|
||||
*command = command.replace(" && ", " and ");
|
||||
eprintln!("command: {}", command);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
@ -276,7 +278,7 @@ pub fn shell_evaluated_commands(shell: &str, command: &str) -> Option<String> {
|
|||
|
||||
#[allow(clippy::single_match)]
|
||||
match shell {
|
||||
"nushell" => Some(cd_dir),
|
||||
"nu" => Some(cd_dir),
|
||||
_ => Some(format!("cd {}", cd_dir)),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue