fix: msys2 path (github #12)

This commit is contained in:
莯凛 2024-11-24 20:00:31 +08:00 committed by GitHub
parent 6feb88d48f
commit 659235bf2e
5 changed files with 80 additions and 13 deletions

View file

@ -153,6 +153,9 @@ pub fn eval_shell_command(shell: &str, command: &str) -> Vec<String> {
}
pub fn split_command(command: &str) -> Vec<String> {
if cfg!(debug_assertions) {
eprintln!("command: {command}")
}
// 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"'\\]+|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\\ )+|\\|\n"#;