breakout tmpl from configgen; stage variations/platform feat
This commit is contained in:
16
src/main.rs
16
src/main.rs
@@ -1,13 +1,14 @@
|
||||
mod cli;
|
||||
mod log;
|
||||
mod specs;
|
||||
mod tmpls;
|
||||
mod render;
|
||||
mod spec;
|
||||
mod tmpl;
|
||||
|
||||
use log::LogLevel;
|
||||
use render::RenderedConfig;
|
||||
use std::fs::{self, File, OpenOptions, create_dir_all, write};
|
||||
use std::io::Write;
|
||||
use std::path::Path;
|
||||
use tmpls::RenderedConfig;
|
||||
use yaml_serde;
|
||||
|
||||
fn main() {
|
||||
@@ -16,11 +17,14 @@ fn main() {
|
||||
|
||||
dbug!(dbg, "{:#?}", &args);
|
||||
|
||||
let specifications: Vec<specs::Specification> =
|
||||
specs::compile(&args.devices, &args.env.spec_path, dbg);
|
||||
let specifications: Vec<spec::Specification> =
|
||||
spec::compile(&args.devices, &args.env.spec_path, dbg);
|
||||
|
||||
for spec in specifications {
|
||||
let result = RenderedConfig::from_spec(&spec, dbg).ok().unwrap();
|
||||
let result = RenderedConfig::from_spec(&spec, dbg).unwrap_or_else(|e| {
|
||||
eprintln!("{}", e);
|
||||
std::process::exit(1);
|
||||
});
|
||||
output_rendered_configs(result, &args.env.out_path, dbg)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user