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 @@ -242,11 +242,18 @@ Arguments:
242
242
let cwd = t ! ( env:: current_dir( ) ) ;
243
243
let paths = matches. free [ 1 ..] . iter ( ) . map ( |p| cwd. join ( p) ) . collect :: < Vec < _ > > ( ) ;
244
244
245
+ let cfg_file = matches. opt_str ( "config" ) . map ( PathBuf :: from) . or_else ( || {
246
+ if fs:: metadata ( "config.toml" ) . is_ok ( ) {
247
+ Some ( PathBuf :: from ( "config.toml" ) )
248
+ } else {
249
+ None
250
+ }
251
+ } ) ;
245
252
246
253
// All subcommands can have an optional "Available paths" section
247
254
if matches. opt_present ( "verbose" ) {
248
255
let flags = Flags :: parse ( & [ "build" . to_string ( ) ] ) ;
249
- let mut config = Config :: default ( ) ;
256
+ let mut config = Config :: parse ( & flags . build , cfg_file . clone ( ) ) ;
250
257
config. build = flags. build . clone ( ) ;
251
258
let mut build = Build :: new ( flags, config) ;
252
259
metadata:: build ( & mut build) ;
@@ -307,14 +314,6 @@ Arguments:
307
314
} ;
308
315
309
316
310
- let cfg_file = matches. opt_str ( "config" ) . map ( PathBuf :: from) . or_else ( || {
311
- if fs:: metadata ( "config.toml" ) . is_ok ( ) {
312
- Some ( PathBuf :: from ( "config.toml" ) )
313
- } else {
314
- None
315
- }
316
- } ) ;
317
-
318
317
let mut stage = matches. opt_str ( "stage" ) . map ( |j| j. parse ( ) . unwrap ( ) ) ;
319
318
320
319
if matches. opt_present ( "incremental" ) {
You can’t perform that action at this time.
0 commit comments