File tree 1 file changed +8
-9
lines changed
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -237,11 +237,18 @@ Arguments:
237
237
let cwd = t ! ( env:: current_dir( ) ) ;
238
238
let paths = matches. free [ 1 ..] . iter ( ) . map ( |p| cwd. join ( p) ) . collect :: < Vec < _ > > ( ) ;
239
239
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
+ } ) ;
240
247
241
248
// All subcommands can have an optional "Available paths" section
242
249
if matches. opt_present ( "verbose" ) {
243
250
let flags = Flags :: parse ( & [ "build" . to_string ( ) ] ) ;
244
- let mut config = Config :: default ( ) ;
251
+ let mut config = Config :: parse ( & flags . build , cfg_file . clone ( ) ) ;
245
252
config. build = flags. build . clone ( ) ;
246
253
let mut build = Build :: new ( flags, config) ;
247
254
metadata:: build ( & mut build) ;
@@ -302,14 +309,6 @@ Arguments:
302
309
} ;
303
310
304
311
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
-
313
312
let mut stage = matches. opt_str ( "stage" ) . map ( |j| j. parse ( ) . unwrap ( ) ) ;
314
313
315
314
if matches. opt_present ( "incremental" ) {
You can’t perform that action at this time.
0 commit comments