Skip to content

Commit

Permalink
v0.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
japaric committed Sep 17, 2021
1 parent b7f8dd7 commit 334832d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [v0.2.5] - 2021-09-17
## [v0.2.6] - 2021-09-17

### Added

- support for suffixed Cargo configuration file (`.cargo/config.toml`)

## [v0.2.5] - 2021-09-17 - YANKED

## [v0.2.4] - 2020-05-29

### Fixed
Expand Down Expand Up @@ -49,7 +51,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

First release

[Unreleased]: https://github.com/japaric/cargo-project/compare/v0.2.5...HEAD
[Unreleased]: https://github.com/japaric/cargo-project/compare/v0.2.6...HEAD
[v0.2.6]: https://github.com/japaric/cargo-project/compare/v0.2.5...v0.2.6
[v0.2.5]: https://github.com/japaric/cargo-project/compare/v0.2.4...v0.2.5
[v0.2.4]: https://github.com/japaric/cargo-project/compare/v0.2.3...v0.2.4
[v0.2.3]: https://github.com/japaric/cargo-project/compare/v0.2.2...v0.2.3
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords = ["Cargo", "project", "subcommand"]
license = "MIT OR Apache-2.0"
name = "cargo-project"
repository = "https://github.com/japaric/cargo-project"
version = "0.2.5"
version = "0.2.6"

[dependencies]
failure = "0.1.2"
Expand Down
11 changes: 5 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,16 @@ impl Project {
// parse Cargo.toml
let toml = root.join("Cargo.toml");
let cargo_config = Path::new(".cargo").join("config");
let cargo_config_toml = cargo_config.with_extension("toml");
let manifest = parse::<Manifest>(&toml)?;

// parse .cargo/config
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) {
let mut config_path = path.join(&cargo_config);
if !config_path.exists() {
config_path.set_extension("toml");
}
let config: Config = parse(&config_path)?;
if let Some(path) = search(root, &cargo_config).map(|path| path.join(cargo_config)).or_else(|| {
search(root, &cargo_config_toml).map(|path| path.join(cargo_config_toml))
}) {
let config: Config = parse(&path)?;

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

0 comments on commit 334832d

Please sign in to comment.