@@ -265,14 +265,12 @@ fn install(cfg: &Cfg, m: &ArgMatches) -> Result<()> {
265
265
}
266
266
267
267
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 < ( ) > {
270
269
path. push ( name. to_owned ( ) + ".bat" ) ;
271
270
utils:: write_file ( name, & path, & format ! ( "@\" %~dp0\\ multirust\" run {} %*" , name) )
272
271
}
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 ( ) ) ;
276
274
utils:: write_file ( name, & path, & format ! ( "#!/bin/sh\n \" `dirname $0`/multirust\" run {} \" $@\" " , name) )
277
275
}
278
276
@@ -291,7 +289,8 @@ fn handle_install(cfg: &Cfg, should_move: bool, add_to_path: bool) -> Result<()>
291
289
292
290
let tools = [ "rustc" , "rustdoc" , "cargo" , "rust-lldb" , "rust-gdb" ] ;
293
291
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) ) ;
295
294
}
296
295
297
296
#[ cfg( windows) ]
0 commit comments