2022-11-27 12:21:35 +01:00
|
|
|
use dotenv::dotenv;
|
2022-11-27 21:10:41 +01:00
|
|
|
use eyre::Context;
|
2022-11-27 12:21:35 +01:00
|
|
|
use tracing_subscriber::prelude::*;
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() -> eyre::Result<()> {
|
2022-11-27 21:10:41 +01:00
|
|
|
if let Err(e) = dotenv().context(".env file not found") {
|
|
|
|
tracing::info!(
|
|
|
|
error = e.to_string(),
|
|
|
|
"no .env file specified, command args are required"
|
|
|
|
);
|
|
|
|
}
|
2022-11-27 12:21:35 +01:00
|
|
|
|
|
|
|
tracing_subscriber::registry()
|
|
|
|
.with(tracing_subscriber::EnvFilter::new(
|
|
|
|
std::env::var("RUST_LOG")
|
|
|
|
.unwrap_or_else(|_| "octopush,octopush_cli,octopush_core,octopush_infra".into()),
|
|
|
|
))
|
|
|
|
.with(tracing_subscriber::fmt::layer())
|
|
|
|
.init();
|
|
|
|
|
|
|
|
let cli = octopush_cli::OctopushCli::new();
|
|
|
|
cli.execute().await
|
|
|
|
}
|