Skip to content

Commit 483367b

Browse files
committed
Always use .msi on windows, even when in msys environment
Emit both shell and bat proxies on all platforms Fixes #3 Fixes #4
1 parent 3852358 commit 483367b

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

Diff for: rust-install/src/dist.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,7 @@ pub fn get_host_triple() -> (&'static str, Option<&'static str>, Option<&'static
207207

208208
pub fn get_installer_ext() -> &'static str {
209209
if cfg!(windows) {
210-
if env::var_os("MSYSTEM").and_then(utils::if_not_empty).is_none() {
211-
return ".msi"
212-
}
210+
return ".msi"
213211
}
214212
".tar.gz"
215213
}

Diff for: src/main.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,12 @@ fn install(cfg: &Cfg, m: &ArgMatches) -> Result<()> {
265265
}
266266

267267
fn handle_install(cfg: &Cfg, should_move: bool, add_to_path: bool) -> Result<()> {
268-
#[cfg(windows)]
269-
fn create_proxy_script(mut path: PathBuf, name: &'static str) -> Result<()> {
268+
fn create_bat_proxy(mut path: PathBuf, name: &'static str) -> Result<()> {
270269
path.push(name.to_owned() + ".bat");
271270
utils::write_file(name, &path, &format!("@\"%~dp0\\multirust\" run {} %*", name))
272271
}
273-
#[cfg(not(windows))]
274-
fn create_proxy_script(mut path: PathBuf, name: &'static str) -> Result<()> {
275-
path.push(name.to_owned() + ".sh");
272+
fn create_sh_proxy(mut path: PathBuf, name: &'static str) -> Result<()> {
273+
path.push(name.to_owned());
276274
utils::write_file(name, &path, &format!("#!/bin/sh\n\"`dirname $0`/multirust\" run {} \"$@\"", name))
277275
}
278276

@@ -291,7 +289,8 @@ fn handle_install(cfg: &Cfg, should_move: bool, add_to_path: bool) -> Result<()>
291289

292290
let tools = ["rustc", "rustdoc", "cargo", "rust-lldb", "rust-gdb"];
293291
for tool in &tools {
294-
try!(create_proxy_script(bin_path.clone(), tool));
292+
try!(create_bat_proxy(bin_path.clone(), tool));
293+
try!(create_sh_proxy(bin_path.clone(), tool));
295294
}
296295

297296
#[cfg(windows)]

0 commit comments

Comments
 (0)