aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/not_bash.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-07 17:38:34 +0100
committerAleksey Kladov <[email protected]>2020-07-07 17:38:34 +0100
commita614d84ff4b4edb43183e5d393ce042f186962a2 (patch)
treee954e38adb5ac1702f3c93cb08763af1a6a855bb /xtask/src/not_bash.rs
parentfaa65d7856314d60e504ebd976a1162342d3b376 (diff)
Automate rust-analyzer promotion
Diffstat (limited to 'xtask/src/not_bash.rs')
-rw-r--r--xtask/src/not_bash.rs12
1 files changed, 11 insertions, 1 deletions
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<Stri
153 153
154// FIXME: some real shell lexing here 154// FIXME: some real shell lexing here
155fn shelx(cmd: &str) -> Vec<String> { 155fn shelx(cmd: &str) -> Vec<String> {
156 cmd.split_whitespace().map(|it| it.to_string()).collect() 156 let mut res = Vec::new();
157 for (string_piece, in_quotes) in cmd.split('\'').zip([false, true].iter().copied().cycle()) {
158 if in_quotes {
159 res.push(string_piece.to_string())
160 } else {
161 if !string_piece.is_empty() {
162 res.extend(string_piece.split_ascii_whitespace().map(|it| it.to_string()))
163 }
164 }
165 }
166 res
157} 167}
158 168
159struct Env { 169struct Env {