Skip to content

Commit e9a124b

Browse files
committed
fix: use current_dir + parent + join to determine default protocol path
1 parent 87da910 commit e9a124b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

crates/sdk/build.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@ fn main() -> Result<()> {
88
.ok_or("Failed to get OUT_DIR! Something must be horribly wrong.")?,
99
);
1010

11-
let protocol_path = std::env::var_os("HARMONY_PROTOCOL_PATH")
12-
.map_or_else(|| PathBuf::from("../../protocol"), PathBuf::from);
11+
let protocol_path = std::env::var_os("HARMONY_PROTOCOL_PATH").map_or_else(
12+
|| {
13+
std::env::current_dir()
14+
.expect("can't get current directory")
15+
.parent()
16+
.expect("expected parent")
17+
.parent()
18+
.expect("expected parent")
19+
.join("protocol")
20+
},
21+
PathBuf::from,
22+
);
1323

1424
#[rustfmt::skip]
1525
let stable_svcs = [

0 commit comments

Comments
 (0)