@@ -65,11 +65,13 @@ pub fn main() {
65
65
. takes_value ( true )
66
66
. conflicts_with_all ( & [ "CRATE_NAME" , "CRATE_VERSION" ] )
67
67
. help ( "Build a crate at a specific path" ) ) )
68
- . subcommand ( SubCommand :: with_name ( "add-essential-files " )
69
- . about ( "Adds essential files for rustc " )
68
+ . subcommand ( SubCommand :: with_name ( "update-toolchain " )
69
+ . about ( "update the curretntly installed rustup toolchain " )
70
70
. arg ( Arg :: with_name ( "ONLY_FIRST_TIME" )
71
71
. long ( "only-first-time" )
72
- . help ( "add essential files only if no essential files are present" ) ) )
72
+ . help ( "update toolchain only if no toolchain is currently installed" ) ) )
73
+ . subcommand ( SubCommand :: with_name ( "add-essential-files" )
74
+ . about ( "Adds essential files for the installed version of rustc" ) )
73
75
. subcommand ( SubCommand :: with_name ( "lock" ) . about ( "Locks cratesfyi daemon to stop \
74
76
building new crates") )
75
77
. subcommand ( SubCommand :: with_name ( "unlock" )
@@ -171,18 +173,20 @@ pub fn main() {
171
173
matches. value_of ( "CRATE_NAME" ) . unwrap ( ) , matches. value_of ( "CRATE_VERSION" ) . unwrap ( ) , None ) ,
172
174
} . expect ( "Building documentation failed" ) ;
173
175
docbuilder. save_cache ( ) . expect ( "Failed to save cache" ) ;
174
- } else if let Some ( m) = matches. subcommand_matches ( "add-essential-files " ) {
176
+ } else if let Some ( m) = matches. subcommand_matches ( "update-toolchain " ) {
175
177
if m. is_present ( "ONLY_FIRST_TIME" ) {
176
178
let conn = db:: connect_db ( ) . unwrap ( ) ;
177
179
let res = conn. query ( "SELECT * FROM config WHERE name = 'rustc_version';" , & [ ] ) . unwrap ( ) ;
178
180
if !res. is_empty ( ) {
179
- println ! ( "add-essential files was already called in the past, exiting" ) ;
181
+ println ! ( "update-toolchain was already called in the past, exiting" ) ;
180
182
return ;
181
183
}
182
184
}
183
-
184
185
let mut builder = RustwideBuilder :: init ( ) . unwrap ( ) ;
185
- builder. update_toolchain ( ) . expect ( "failed to add essential files" ) ;
186
+ builder. update_toolchain ( ) . expect ( "failed to update toolchain" ) ;
187
+ } else if matches. subcommand_matches ( "add-essential-files" ) . is_some ( ) {
188
+ let mut builder = RustwideBuilder :: init ( ) . unwrap ( ) ;
189
+ builder. add_essential_files ( ) . expect ( "failed to add essential files" ) ;
186
190
} else if let Some ( _) = matches. subcommand_matches ( "lock" ) {
187
191
docbuilder. lock ( ) . expect ( "Failed to lock" ) ;
188
192
} else if let Some ( _) = matches. subcommand_matches ( "unlock" ) {
0 commit comments