mirror of
https://github.com/nushell/nushell.git
synced 2024-12-25 08:29:07 +01:00
Respect CARGO_TARGET_DIR when set (#1528)
This makes the `binaries` function respect the `CARGO_TARGET_DIR` environment variable when set. If it's not present it falls back to the regular target directory used by Cargo.
This commit is contained in:
parent
06f87cfbe8
commit
a5e97ca549
@ -246,7 +246,10 @@ pub fn root() -> PathBuf {
|
||||
}
|
||||
|
||||
pub fn binaries() -> PathBuf {
|
||||
root().join("target/debug")
|
||||
std::env::var("CARGO_TARGET_DIR")
|
||||
.ok()
|
||||
.map(|target_dir| PathBuf::from(target_dir).join("debug"))
|
||||
.unwrap_or_else(|| root().join("target/debug"))
|
||||
}
|
||||
|
||||
pub fn fixtures() -> PathBuf {
|
||||
|
Loading…
Reference in New Issue
Block a user