From a614d84ff4b4edb43183e5d393ce042f186962a2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 7 Jul 2020 18:38:34 +0200 Subject: Automate rust-analyzer promotion --- xtask/src/not_bash.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'xtask/src/not_bash.rs') diff --git a/xtask/src/not_bash.rs b/xtask/src/not_bash.rs index a6431e586..8844fa216 100644 --- a/xtask/src/not_bash.rs +++ b/xtask/src/not_bash.rs @@ -153,7 +153,17 @@ fn run_process_inner(cmd: &str, echo: bool, stdin: Option<&[u8]>) -> Result Vec { - cmd.split_whitespace().map(|it| it.to_string()).collect() + let mut res = Vec::new(); + for (string_piece, in_quotes) in cmd.split('\'').zip([false, true].iter().copied().cycle()) { + if in_quotes { + res.push(string_piece.to_string()) + } else { + if !string_piece.is_empty() { + res.extend(string_piece.split_ascii_whitespace().map(|it| it.to_string())) + } + } + } + res } struct Env { -- cgit v1.2.3