diff options
author | Aleksey Kladov <[email protected]> | 2020-07-07 17:38:34 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-07 17:38:34 +0100 |
commit | a614d84ff4b4edb43183e5d393ce042f186962a2 (patch) | |
tree | e954e38adb5ac1702f3c93cb08763af1a6a855bb /xtask/src/not_bash.rs | |
parent | faa65d7856314d60e504ebd976a1162342d3b376 (diff) |
Automate rust-analyzer promotion
Diffstat (limited to 'xtask/src/not_bash.rs')
-rw-r--r-- | xtask/src/not_bash.rs | 12 |
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 |
155 | fn shelx(cmd: &str) -> Vec<String> { | 155 | fn 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 | ||
159 | struct Env { | 169 | struct Env { |