mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Place config.toml in current working directory if config not found
This commit is contained in:
parent
371100b1fb
commit
13d4c61b5f
@ -35,7 +35,7 @@ fn main() {
|
||||
|
||||
// NOTE: Since `./configure` generates a `config.toml`, distro maintainers will see the
|
||||
// changelog warning, not the `x.py setup` message.
|
||||
let suggest_setup = !config.config.exists() && !matches!(config.cmd, Subcommand::Setup { .. });
|
||||
let suggest_setup = config.config.is_none() && !matches!(config.cmd, Subcommand::Setup { .. });
|
||||
if suggest_setup {
|
||||
println!("warning: you have not made a `config.toml`");
|
||||
println!(
|
||||
|
@ -80,7 +80,7 @@ pub struct Config {
|
||||
pub keep_stage_std: Vec<u32>,
|
||||
pub src: PathBuf,
|
||||
/// defaults to `config.toml`
|
||||
pub config: PathBuf,
|
||||
pub config: Option<PathBuf>,
|
||||
pub jobs: Option<u32>,
|
||||
pub cmd: Subcommand,
|
||||
pub incremental: bool,
|
||||
@ -942,7 +942,7 @@ impl Config {
|
||||
}
|
||||
|
||||
config.changelog_seen = toml.changelog_seen;
|
||||
config.config = toml_path;
|
||||
config.config = if toml_path.exists() { Some(toml_path) } else { None };
|
||||
|
||||
let build = toml.build.unwrap_or_default();
|
||||
|
||||
|
@ -82,7 +82,7 @@ impl fmt::Display for Profile {
|
||||
}
|
||||
|
||||
pub fn setup(config: &Config, profile: Profile) {
|
||||
let path = &config.config;
|
||||
let path = &config.config.clone().unwrap_or(PathBuf::from("config.toml"));
|
||||
|
||||
if path.exists() {
|
||||
eprintln!(
|
||||
|
Loading…
Reference in New Issue
Block a user