forked from brl/citadel-tools
citadel-tool now installed with a hardlink for each binary tool and dispatches on the exe path to the tool implementation. This makes the build faster, uses less disk space, and makes it easier to create new small tools.
31 lines
600 B
Rust
31 lines
600 B
Rust
|
|
use std::process::exit;
|
|
|
|
use libcitadel::Result;
|
|
|
|
mod config;
|
|
mod build;
|
|
|
|
pub fn main(args: Vec<String>) {
|
|
|
|
let config_path = match args.iter().skip(1).next() {
|
|
Some(arg) => arg,
|
|
None => {
|
|
println!("Expected config file argument");
|
|
exit(1);
|
|
},
|
|
};
|
|
|
|
if let Err(err) = build_image(config_path) {
|
|
println!("Error: {}", err);
|
|
exit(1);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
fn build_image(config_path: &str) -> Result<()> {
|
|
let conf = config::BuildConfig::load(config_path)?;
|
|
let mut builder = build::UpdateBuilder::new(conf);
|
|
builder.build()
|
|
} |