Skip to content

Commit

Permalink
fix: use current_dir + parent + join to determine default protocol path
Browse files Browse the repository at this point in the history
  • Loading branch information
yusdacra committed Feb 9, 2022
1 parent 87da910 commit e9a124b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions crates/sdk/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ fn main() -> Result<()> {
.ok_or("Failed to get OUT_DIR! Something must be horribly wrong.")?,
);

let protocol_path = std::env::var_os("HARMONY_PROTOCOL_PATH")
.map_or_else(|| PathBuf::from("../../protocol"), PathBuf::from);
let protocol_path = std::env::var_os("HARMONY_PROTOCOL_PATH").map_or_else(
|| {
std::env::current_dir()
.expect("can't get current directory")
.parent()
.expect("expected parent")
.parent()
.expect("expected parent")
.join("protocol")
},
PathBuf::from,
);

#[rustfmt::skip]
let stable_svcs = [
Expand Down

0 comments on commit e9a124b

Please sign in to comment.