Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 3899a4a

Browse files
committed
feat: add build script for topos-sequencer-subnet-client
Signed-off-by: Jawad Tariq <sjcool420@hotmail.co.uk>
1 parent b469dfe commit 3899a4a

File tree

1 file changed

+36
-0
lines changed
  • crates/topos-sequencer-subnet-client

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
use std::process::{exit, Command};
2+
3+
const CONTRACTS_PATH: &str = "../../contracts";
4+
5+
fn main() {
6+
if !CONTRACTS_PATH.is_empty() {
7+
std::env::set_current_dir(CONTRACTS_PATH).unwrap_or_else(|err| {
8+
eprintln!("Error changing to subdirectory: {}", err);
9+
exit(1);
10+
});
11+
}
12+
13+
Command::new("npm")
14+
.arg("ci")
15+
.status()
16+
.unwrap_or_else(|err| {
17+
eprintln!("Error executing npm ci: {}", err);
18+
exit(1);
19+
});
20+
21+
Command::new("npm")
22+
.arg("run")
23+
.arg("build")
24+
.status()
25+
.unwrap_or_else(|err| {
26+
eprintln!("Error executing npm run build: {}", err);
27+
exit(1);
28+
});
29+
30+
std::env::set_current_dir("..").unwrap_or_else(|err| {
31+
eprintln!("Error changing back to the original directory: {}", err);
32+
exit(1);
33+
});
34+
35+
println!("cargo:rerun-if-changed={}", CONTRACTS_PATH);
36+
}

0 commit comments

Comments
 (0)