mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-11 22:10:09 +01:00
fix: things with nushell
This commit is contained in:
parent
e1e9c14b47
commit
58b6a65a75
6 changed files with 15 additions and 10 deletions
|
|
@ -694,7 +694,7 @@ pub fn get_shell() -> String {
|
|||
pub fn shell_syntax(shell: &str, command: &str) -> String {
|
||||
#[allow(clippy::single_match)]
|
||||
match shell {
|
||||
"nu" => command.replace("&&", ";").to_string(),
|
||||
"nu" => command.replace("&&\n", ";\n").to_string(),
|
||||
_ => command.to_string(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ cd {{typo[1](file)}}
|
|||
''',
|
||||
'''
|
||||
#[!shell(nu)]
|
||||
mkdir --parents {{command[1]}} && \
|
||||
mkdir --parents {{command[1]}} &&
|
||||
cd {{command[1]}} '''
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ pattern = [
|
|||
suggest = [
|
||||
'''
|
||||
#[err_contains(no such file or directory)]
|
||||
mkdir -p {{cmd::(?m)\s(\S+[\\\/])\S*\s*$}} && \
|
||||
mkdir -p {{cmd::(?m)\s(\S+[\\\/])\S*\s*$}} &&
|
||||
{{command[0]}} {{opt::(?:\s)(-[\w]+)}} {{command[1:]}} '''
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ pattern = [
|
|||
suggest = [
|
||||
'''
|
||||
#[cmd_contains(push)]
|
||||
git pull && \
|
||||
git pull &&
|
||||
{{command}} ''',
|
||||
'''
|
||||
#[cmd_contains(push)]
|
||||
|
|
@ -136,8 +136,8 @@ suggest = [
|
|||
#[cmd_contains(pull)]
|
||||
{{command}} --rebase --autostash ''',
|
||||
'''
|
||||
git stash && \
|
||||
{{command}} && \
|
||||
git stash &&
|
||||
{{command}} &&
|
||||
git stash pop '''
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ pattern = [
|
|||
]
|
||||
suggest = [
|
||||
'''
|
||||
mkdir --parents {{command[-1]}} && \
|
||||
mkdir --parents {{command[-1]}} &&
|
||||
{{command}} '''
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -4,14 +4,19 @@ command = "touch"
|
|||
pattern = [ "no such file or directory" ]
|
||||
suggest = [
|
||||
'''
|
||||
mkdir --parents {{cmd::(?:\s)+(.*[\\\/])(?:\s)*}} && \
|
||||
#[!shell(nu)]
|
||||
mkdir --parents {{cmd::(?:\s)+(.*[\\\/])(?:\s)*}} &&
|
||||
touch {{command[1:]}} '''
|
||||
]
|
||||
|
||||
[[match_err]]
|
||||
pattern = [ "nu::shell::create_not_possible" ]
|
||||
pattern = [
|
||||
"nu::shell::create_not_possible",
|
||||
"no such file or directory",
|
||||
]
|
||||
suggest = [
|
||||
'''
|
||||
mkdir {{cmd::(?:\s)+(.*[\\\/])(?:\s)*}} and \
|
||||
#[shell(nu)]
|
||||
mkdir {{cmd::(?:\s)+(.*[\\\/])(?:\s)*}};
|
||||
touch {{command[1:]}} '''
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue