Skip to content

Commit

Permalink
Merge pull request #178 from jakobhellermann/respect-target-dir-env
Browse files Browse the repository at this point in the history
feat: respect CARGO_TARGET_DIR variable if set
  • Loading branch information
mdsteele authored Mar 19, 2024
2 parents 02417ba + 05f4ef9 commit 60cf179
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bundle/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ impl Settings {
profile: &str,
build_artifact: &BuildArtifact,
) -> PathBuf {
let mut path = project_root_dir.join("target");
let target_dir_env = std::env::var("CARGO_TARGET_DIR").map(PathBuf::from);
let mut path = target_dir_env.unwrap_or(project_root_dir.join("target"));

if let &Some((ref triple, _)) = target {
path.push(triple);
}
Expand Down

0 comments on commit 60cf179

Please sign in to comment.