use clap::Clap; extern crate pretty_env_logger; #[macro_use] extern crate log; #[macro_use] extern crate serde_derive; #[macro_use] mod utils; /// Activation portion of the simple Rust Nix deploy tool #[derive(Clap, Debug)] #[clap(version = "1.0", author = "notgne2 ")] struct Opts { profile_path: String, closure: String, /// Command for activating the given profile #[clap(long)] activate_cmd: Option, /// Command for bootstrapping #[clap(long)] bootstrap_cmd: Option, /// Auto rollback if failure #[clap(long)] auto_rollback: bool, } #[tokio::main] async fn main() -> Result<(), Box> { if std::env::var("DEPLOY_LOG").is_err() { std::env::set_var("DEPLOY_LOG", "info"); } pretty_env_logger::init_custom_env("DEPLOY_LOG"); let opts: Opts = Opts::parse(); utils::activate::activate( opts.profile_path, opts.closure, opts.activate_cmd, opts.bootstrap_cmd, opts.auto_rollback, ) .await?; Ok(()) }