@@ -112,7 +112,7 @@ macro_rules! post_install_msg_unix {
112
112
( ) => {
113
113
r"# Rust is installed now. Great!
114
114
115
- To get started you need Cargo's bin directory in your `PATH`
115
+ To get started you need Cargo's bin directory ({cargo_home}/bin) in your `PATH`
116
116
environment variable. Next time you log in this will be done
117
117
automatically.
118
118
@@ -125,7 +125,7 @@ macro_rules! post_install_msg_win {
125
125
( ) => {
126
126
r"# Rust is installed now. Great!
127
127
128
- To get started you need Cargo's bin directory in your `PATH`
128
+ To get started you need Cargo's bin directory ({cargo_home}\bin) in your `PATH`
129
129
environment variable. Future applications will automatically have the
130
130
correct environment, but you may need to restart your current shell.
131
131
"
@@ -136,7 +136,7 @@ macro_rules! post_install_msg_unix_no_modify_path {
136
136
( ) => {
137
137
r"# Rust is installed now. Great!
138
138
139
- To get started you need Cargo's bin directory in your `PATH`
139
+ To get started you need Cargo's bin directory ({cargo_home}/bin) in your `PATH`
140
140
environment variable.
141
141
142
142
To configure your current shell run `source {cargo_home}/env`
@@ -148,7 +148,7 @@ macro_rules! post_install_msg_win_no_modify_path {
148
148
( ) => {
149
149
r"# Rust is installed now. Great!
150
150
151
- To get started you need Cargo's bin directory in your `PATH`
151
+ To get started you need Cargo's bin directory ({cargo_home}\bin) in your `PATH`
152
152
environment variable. This has not been done automatically.
153
153
"
154
154
} ;
@@ -204,7 +204,11 @@ fn canonical_cargo_home() -> Result<String> {
204
204
205
205
let default_cargo_home = utils:: home_dir ( ) . unwrap_or ( PathBuf :: from ( "." ) ) . join ( ".cargo" ) ;
206
206
if default_cargo_home == path {
207
- path_str = String :: from ( "$HOME/.cargo" ) ;
207
+ if cfg ! ( unix) {
208
+ path_str = String :: from ( "$HOME/.cargo" ) ;
209
+ } else {
210
+ path_str = String :: from ( r"%USERPROFILE%\.cargo" ) ;
211
+ }
208
212
}
209
213
210
214
Ok ( path_str)
@@ -288,21 +292,22 @@ pub fn install(no_prompt: bool, verbose: bool,
288
292
289
293
// More helpful advice, skip if -y
290
294
if !no_prompt {
295
+ let cargo_home = try!( canonical_cargo_home ( ) ) ;
291
296
let msg = if !opts. no_modify_path {
292
297
if cfg ! ( unix) {
293
- let cargo_home = try!( canonical_cargo_home ( ) ) ;
294
298
format ! ( post_install_msg_unix!( ) ,
295
299
cargo_home = cargo_home)
296
300
} else {
297
- format ! ( post_install_msg_win!( ) )
301
+ format ! ( post_install_msg_win!( ) ,
302
+ cargo_home = cargo_home)
298
303
}
299
304
} else {
300
305
if cfg ! ( unix) {
301
- let cargo_home = try!( canonical_cargo_home ( ) ) ;
302
306
format ! ( post_install_msg_unix_no_modify_path!( ) ,
303
307
cargo_home = cargo_home)
304
308
} else {
305
- format ! ( post_install_msg_win_no_modify_path!( ) )
309
+ format ! ( post_install_msg_win_no_modify_path!( ) ,
310
+ cargo_home = cargo_home)
306
311
}
307
312
} ;
308
313
term2:: stdout ( ) . md ( msg) ;
0 commit comments