Skip to content

Commit 3c16352

Browse files
committed
add solana check
1 parent 483c564 commit 3c16352

File tree

1 file changed

+19
-0
lines changed
  • tokens/pda-mint-authority/steel/program

1 file changed

+19
-0
lines changed

tokens/pda-mint-authority/steel/program/build.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,28 @@
22
use std::fs;
33
use std::process::Command;
44

5+
fn check_solana_installation() -> Result<(), String> {
6+
match Command::new("solana").arg("--version").output() {
7+
Ok(output) => {
8+
if output.status.success() {
9+
Ok(())
10+
} else {
11+
Err("Solana CLI is available but returned an error".to_string())
12+
}
13+
}
14+
Err(e) => Err(format!("Solana CLI is not installed or not in PATH: {}", e)),
15+
}
16+
}
17+
518
fn main() {
619
println!("cargo:rerun-if-changed=build.rs");
720

21+
// Check if Solana is installed
22+
if let Err(err) = check_solana_installation() {
23+
println!("cargo:warning=Solana check failed: {}", err);
24+
return;
25+
}
26+
827
// Create the fixtures directory path
928
fs::create_dir_all("tests/fixtures").expect("Failed to create fixtures directory");
1029

0 commit comments

Comments
 (0)