File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,9 @@ macro_rules! pre_install_msg_unix {
86
86
( ) => {
87
87
pre_install_msg_template!(
88
88
"This path will then be added to your `PATH` environment variable by
89
- modifying the profile file located at:
89
+ modifying the profile file{plural} located at:
90
90
91
- {rcfiles}"
91
+ {rcfiles}"
92
92
) } ;
93
93
}
94
94
@@ -492,10 +492,13 @@ fn pre_install_msg(no_modify_path: bool) -> Result<String> {
492
492
None
493
493
}
494
494
} ) . collect :: < Vec < _ > > ( ) ;
495
- assert_eq ! ( rcfiles. len( ) , 1 ) ; // Only modifying .profile
495
+ let plural = if rcfiles. len ( ) > 1 { "s" } else { "" } ;
496
+ let rcfiles = rcfiles. into_iter ( ) . map ( |f| format ! ( " {}" , f) ) . collect :: < Vec < _ > > ( ) ;
497
+ let rcfiles = rcfiles. join ( "\n " ) ;
496
498
Ok ( format ! ( pre_install_msg_unix!( ) ,
497
499
cargo_home_bin = cargo_home_bin. display( ) ,
498
- rcfiles = rcfiles[ 0 ] ) )
500
+ plural = plural,
501
+ rcfiles = rcfiles) )
499
502
} else {
500
503
Ok ( format ! ( pre_install_msg_win!( ) ,
501
504
cargo_home_bin = cargo_home_bin. display( ) ) )
You can’t perform that action at this time.
0 commit comments