File tree 3 files changed +4
-4
lines changed
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ fn main() {
35
35
36
36
// NOTE: Since `./configure` generates a `config.toml`, distro maintainers will see the
37
37
// changelog warning, not the `x.py setup` message.
38
- let suggest_setup = ! config. config . exists ( ) && !matches ! ( config. cmd, Subcommand :: Setup { .. } ) ;
38
+ let suggest_setup = config. config . is_none ( ) && !matches ! ( config. cmd, Subcommand :: Setup { .. } ) ;
39
39
if suggest_setup {
40
40
println ! ( "warning: you have not made a `config.toml`" ) ;
41
41
println ! (
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ pub struct Config {
80
80
pub keep_stage_std : Vec < u32 > ,
81
81
pub src : PathBuf ,
82
82
/// defaults to `config.toml`
83
- pub config : PathBuf ,
83
+ pub config : Option < PathBuf > ,
84
84
pub jobs : Option < u32 > ,
85
85
pub cmd : Subcommand ,
86
86
pub incremental : bool ,
@@ -942,7 +942,7 @@ impl Config {
942
942
}
943
943
944
944
config. changelog_seen = toml. changelog_seen ;
945
- config. config = toml_path;
945
+ config. config = if toml_path. exists ( ) { Some ( toml_path ) } else { None } ;
946
946
947
947
let build = toml. build . unwrap_or_default ( ) ;
948
948
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ impl fmt::Display for Profile {
82
82
}
83
83
84
84
pub fn setup ( config : & Config , profile : Profile ) {
85
- let path = & config. config ;
85
+ let path = & config. config . clone ( ) . unwrap_or ( PathBuf :: from ( "config.toml" ) ) ;
86
86
87
87
if path. exists ( ) {
88
88
eprintln ! (
You can’t perform that action at this time.
0 commit comments