File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -237,11 +237,18 @@ Arguments:
237237 let cwd = t ! ( env:: current_dir( ) ) ;
238238 let paths = matches. free [ 1 ..] . iter ( ) . map ( |p| cwd. join ( p) ) . collect :: < Vec < _ > > ( ) ;
239239
240+ let cfg_file = matches. opt_str ( "config" ) . map ( PathBuf :: from) . or_else ( || {
241+ if fs:: metadata ( "config.toml" ) . is_ok ( ) {
242+ Some ( PathBuf :: from ( "config.toml" ) )
243+ } else {
244+ None
245+ }
246+ } ) ;
240247
241248 // All subcommands can have an optional "Available paths" section
242249 if matches. opt_present ( "verbose" ) {
243250 let flags = Flags :: parse ( & [ "build" . to_string ( ) ] ) ;
244- let mut config = Config :: default ( ) ;
251+ let mut config = Config :: parse ( & flags . build , cfg_file . clone ( ) ) ;
245252 config. build = flags. build . clone ( ) ;
246253 let mut build = Build :: new ( flags, config) ;
247254 metadata:: build ( & mut build) ;
@@ -302,14 +309,6 @@ Arguments:
302309 } ;
303310
304311
305- let cfg_file = matches. opt_str ( "config" ) . map ( PathBuf :: from) . or_else ( || {
306- if fs:: metadata ( "config.toml" ) . is_ok ( ) {
307- Some ( PathBuf :: from ( "config.toml" ) )
308- } else {
309- None
310- }
311- } ) ;
312-
313312 let mut stage = matches. opt_str ( "stage" ) . map ( |j| j. parse ( ) . unwrap ( ) ) ;
314313
315314 if matches. opt_present ( "incremental" ) {
You can’t perform that action at this time.
0 commit comments