mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 14:30:10 +01:00
feat: allow using line continuations in templates
This commit is contained in:
parent
a193a86a5f
commit
498a134da3
4 changed files with 8 additions and 11 deletions
|
|
@ -123,7 +123,7 @@ fn eval_shell_command(shell: &str, command: &str) -> Vec<String> {
|
|||
pub fn split_command(command: &str) -> Vec<String> {
|
||||
// this regex splits the command separated by spaces, except when the space
|
||||
// is escaped by a backslash or surrounded by quotes
|
||||
let regex = r#"([^\s"'\\]+|"(?:\\.|[^"\\])*"|\\\s+|'(?:\\.|[^'\\])*'|\\\s)+"#;
|
||||
let regex = r#"([^\s"'\\]+|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\\ )+|\\|\n"#;
|
||||
let regex = Regex::new(regex).unwrap();
|
||||
let split_command = regex
|
||||
.find_iter(command)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue