Skip to content

Commit

Permalink
fix foundry root
Browse files Browse the repository at this point in the history
  • Loading branch information
Wollac committed Nov 21, 2024
1 parent e942ccc commit dc82d73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/op/common/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ use std::{env, path::PathBuf, process::Command};
fn main() {
let manifest_dir =
PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set"));
let foundry_root = manifest_dir.join("../contracts/");

let mut foundry_root = manifest_dir.clone();
foundry_root.pop();
foundry_root.push("contracts");
println!("foundry root: {}", foundry_root.display());

// Make sure the Verifier.sol file is always compiled.
let status = Command::new("forge")
.arg("build")
.arg("Verifier.sol")
.current_dir(foundry_root)
.arg("--root")
.arg(foundry_root)
.status()
.expect("failed to execute process");
assert!(status.success(), "forge build failed");
Expand Down

0 comments on commit dc82d73

Please sign in to comment.