Add manager script
This commit is contained in:
42
manager/src/main.rs
Normal file
42
manager/src/main.rs
Normal file
@ -0,0 +1,42 @@
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
mod builder;
|
||||
mod linker;
|
||||
|
||||
use builder::build_tree;
|
||||
use linker::link_tree;
|
||||
use std::path::PathBuf;
|
||||
use structopt::StructOpt;
|
||||
use tokio::io;
|
||||
|
||||
#[derive(StructOpt)]
|
||||
pub struct Opt {
|
||||
template_dir: PathBuf,
|
||||
build_dir: PathBuf,
|
||||
link_dir: PathBuf,
|
||||
|
||||
#[structopt(subcommand)]
|
||||
color: Option<ColorMode>,
|
||||
}
|
||||
|
||||
#[derive(StructOpt, PartialEq, Eq, Clone, Copy)]
|
||||
pub enum ColorMode {
|
||||
Dark,
|
||||
Light,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> io::Result<()> {
|
||||
pretty_env_logger::init();
|
||||
|
||||
let opt = Opt::from_args();
|
||||
|
||||
info!("building tree");
|
||||
build_tree(&opt).await?;
|
||||
|
||||
info!("linking tree");
|
||||
link_tree(&opt).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user