You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
798 B
Rust

#![feature(let_chains)]
use std::process::ExitCode;
use clap::Parser;
use self::cli::parameters::Cli;
use self::cli::parameters::Commands;
use self::command::build::build_site;
use self::command::init::init_natter_folder;
use self::error::CustomError;
mod cli;
mod command;
mod config;
mod context;
mod error;
mod intermediate;
mod render;
fn main() -> Result<ExitCode, CustomError> {
let rt = tokio::runtime::Runtime::new()?;
rt.block_on(async { main_body().await })
}
async fn main_body() -> Result<ExitCode, CustomError> {
let args = Cli::parse();
match args.command {
Commands::Init(args) => {
init_natter_folder(args).await?;
}
Commands::Build(args) => {
build_site(args).await?;
}
};
Ok(ExitCode::SUCCESS)
}