Skip to content

Commit

Permalink
Fix near-test-contracts build script to work if CARGO_TARGET_DIR is s…
Browse files Browse the repository at this point in the history
…et. (#6171)

This will fix the nightly build which in turn will let `nearup` download binaries again.

Tested by running `make nightly-release` with and without `CARGO_TARGET_DIR` environment variable.
  • Loading branch information
nikurt authored Jan 25, 2022
1 parent 33570ba commit 87eb325
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtime/near-test-contracts/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ fn build_contract(dir: &str, args: &[&str], output: &str) -> io::Result<()> {
cmd.current_dir(dir);
check_status(cmd)?;

let target_dir = shared_target_dir().unwrap_or_else(|| format!("./{}/target", dir).into());
let target_dir =
Path::new(dir).join(shared_target_dir().unwrap_or(Path::new("target").to_path_buf()));
fs::copy(
target_dir.join(format!("wasm32-unknown-unknown/release/{}.wasm", dir.replace('-', "_"))),
format!("./res/{}.wasm", output),
Expand Down

0 comments on commit 87eb325

Please sign in to comment.