diff options
Diffstat (limited to 'xtask/src/install.rs')
-rw-r--r-- | xtask/src/install.rs | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/xtask/src/install.rs b/xtask/src/install.rs index 0e7cda3fa..99e1eddb1 100644 --- a/xtask/src/install.rs +++ b/xtask/src/install.rs | |||
@@ -127,15 +127,12 @@ fn install_client(ClientOpt::VsCode: ClientOpt) -> Result<()> { | |||
127 | } | 127 | } |
128 | .run()?; | 128 | .run()?; |
129 | 129 | ||
130 | let installed_extensions = { | 130 | let installed_extensions = Cmd { |
131 | let output = Cmd { | 131 | unix: &format!(r"{} --list-extensions", code_binary), |
132 | unix: &format!(r"{} --list-extensions", code_binary), | 132 | windows: &format!(r"cmd.exe /c {}.cmd --list-extensions", code_binary), |
133 | windows: &format!(r"cmd.exe /c {}.cmd --list-extensions", code_binary), | 133 | work_dir: ".", |
134 | work_dir: ".", | 134 | } |
135 | } | 135 | .run_with_output()?; |
136 | .run_with_output()?; | ||
137 | String::from_utf8(output.stdout)? | ||
138 | }; | ||
139 | 136 | ||
140 | if !installed_extensions.contains("rust-analyzer") { | 137 | if !installed_extensions.contains("rust-analyzer") { |
141 | anyhow::bail!( | 138 | anyhow::bail!( |
@@ -161,12 +158,10 @@ fn install_client(ClientOpt::VsCode: ClientOpt) -> Result<()> { | |||
161 | 158 | ||
162 | fn install_server(opts: ServerOpt) -> Result<()> { | 159 | fn install_server(opts: ServerOpt) -> Result<()> { |
163 | let mut old_rust = false; | 160 | let mut old_rust = false; |
164 | if let Ok(output) = run_with_output("cargo --version", ".") { | 161 | if let Ok(stdout) = run_with_output("cargo --version", ".") { |
165 | if let Ok(stdout) = String::from_utf8(output.stdout) { | 162 | println!("{}", stdout); |
166 | println!("{}", stdout); | 163 | if !check_version(&stdout, REQUIRED_RUST_VERSION) { |
167 | if !check_version(&stdout, REQUIRED_RUST_VERSION) { | 164 | old_rust = true; |
168 | old_rust = true; | ||
169 | } | ||
170 | } | 165 | } |
171 | } | 166 | } |
172 | 167 | ||