diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-01-13 10:13:47 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-01-13 10:13:47 +0000 |
commit | 5fd1b044b6eddc05d51a74a681f8f7af3fcdca55 (patch) | |
tree | 0567125953f4ca0e6c6086e1b20b161fcc9d71ca /xtask | |
parent | a05970da4671bd78457635deefa5ed8a2d24b00c (diff) | |
parent | bd7aa5db149012c54aea228839e44aa8d1b53a15 (diff) |
Merge #2768
2768: Rename VS Code extension to rust-analyzer r=matklad a=matklad
I want to merge this before release on Monday, such that we can give heads up on twitter
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'xtask')
-rw-r--r-- | xtask/src/install.rs | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/xtask/src/install.rs b/xtask/src/install.rs index fa82633de..bffd91af1 100644 --- a/xtask/src/install.rs +++ b/xtask/src/install.rs | |||
@@ -107,29 +107,44 @@ fn install_client(ClientOpt::VsCode: ClientOpt) -> Result<()> { | |||
107 | }; | 107 | }; |
108 | 108 | ||
109 | Cmd { | 109 | Cmd { |
110 | unix: &format!(r"{} --install-extension ./ra-lsp-0.0.1.vsix --force", code_binary), | 110 | unix: &format!(r"{} --install-extension ./rust-analyzer-0.1.0.vsix --force", code_binary), |
111 | windows: &format!( | 111 | windows: &format!( |
112 | r"cmd.exe /c {}.cmd --install-extension ./ra-lsp-0.0.1.vsix --force", | 112 | r"cmd.exe /c {}.cmd --install-extension ./rust-analyzer-0.1.0.vsix --force", |
113 | code_binary | 113 | code_binary |
114 | ), | 114 | ), |
115 | work_dir: "./editors/code", | 115 | work_dir: "./editors/code", |
116 | } | 116 | } |
117 | .run()?; | 117 | .run()?; |
118 | 118 | ||
119 | let output = Cmd { | 119 | let installed_extensions = { |
120 | unix: &format!(r"{} --list-extensions", code_binary), | 120 | let output = Cmd { |
121 | windows: &format!(r"cmd.exe /c {}.cmd --list-extensions", code_binary), | 121 | unix: &format!(r"{} --list-extensions", code_binary), |
122 | work_dir: ".", | 122 | windows: &format!(r"cmd.exe /c {}.cmd --list-extensions", code_binary), |
123 | } | 123 | work_dir: ".", |
124 | .run_with_output()?; | 124 | } |
125 | .run_with_output()?; | ||
126 | String::from_utf8(output.stdout)? | ||
127 | }; | ||
125 | 128 | ||
126 | if !str::from_utf8(&output.stdout)?.contains("ra-lsp") { | 129 | if !installed_extensions.contains("rust-analyzer") { |
127 | anyhow::bail!( | 130 | anyhow::bail!( |
128 | "Could not install the Visual Studio Code extension. \ | 131 | "Could not install the Visual Studio Code extension. \ |
129 | Please make sure you have at least NodeJS 10.x together with the latest version of VS Code installed and try again." | 132 | Please make sure you have at least NodeJS 10.x together with the latest version of VS Code installed and try again." |
130 | ); | 133 | ); |
131 | } | 134 | } |
132 | 135 | ||
136 | if installed_extensions.contains("ra-lsp") { | ||
137 | Cmd { | ||
138 | unix: &format!(r"{} --uninstall-extension matklad.ra-lsp", code_binary), | ||
139 | windows: &format!( | ||
140 | r"cmd.exe /c {}.cmd --uninstall-extension matklad.ra-lsp", | ||
141 | code_binary | ||
142 | ), | ||
143 | work_dir: "./editors/code", | ||
144 | } | ||
145 | .run()?; | ||
146 | } | ||
147 | |||
133 | Ok(()) | 148 | Ok(()) |
134 | } | 149 | } |
135 | 150 | ||