Skip to content

Commit

Permalink
support .cargo/config.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
benmkw committed Aug 22, 2020
1 parent 6f7e79e commit 7619f29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ impl Project {
// parse Cargo.toml
let toml = root.join("Cargo.toml");
let cargo_config = Path::new(".cargo").join("config");
let cargo_config_toml = Path::new(".cargo").join("config.toml");
let manifest = parse::<Manifest>(&toml)?;

// parse .cargo/config
// parse .cargo/config or .cargo/config.toml
let mut target = None;
let mut target_dir = env::var_os("CARGO_TARGET_DIR").map(PathBuf::from);
if let Some(path) = search(root, &cargo_config) {
if let Some(path) = search(root, &cargo_config).or_else(|| search(root, &cargo_config_toml))
{
let config: Config = parse(&path.join(&cargo_config))?;

if let Some(build) = config.build {
Expand Down

0 comments on commit 7619f29

Please sign in to comment.