Skip to content

Commit

Permalink
Check that required or or optional binary dependencies are installed
Browse files Browse the repository at this point in the history
  • Loading branch information
MikailBag committed Sep 26, 2019
1 parent 2277586 commit b2941aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ then
echo "Error: rustc not found"
exit 1
fi
echo "checking rustc is installed... ok"

RustcVersionDataRaw=$( rustc --version )

Expand Down
22 changes: 22 additions & 0 deletions deploy/bin/configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,29 @@ fn check_build_dir(_src: &str, build: &str) {
std::process::exit(1);
}

fn check_env() {
for (bin, cmd) in &[
("cmake", vec![]),
("gcc", vec!["--version"]),
("g++", vec!["--version"]),
("mdbook", vec!["--version"]),
] {
print!("checking {} is installed... ", bin);
let st = std::process::Command::new(bin)
.args(cmd)
.output()
.map(|st| st.status.success())
.unwrap_or(false);
if !st {
println!("no");
} else {
println!("ok");
}
}
}

fn main() {
check_env();
let jjs_path = std::env::var("JJS_CFGR_SOURCE_DIR").unwrap();
let build_dir_path = std::env::current_dir()
.unwrap()
Expand Down

0 comments on commit b2941aa

Please sign in to comment.