24bac982f1
These are the layer directly over dust which can be used by anything, not just blog posts.
37 lines
819 B
Rust
37 lines
819 B
Rust
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_writer_folder;
|
|
use self::error::CustomError;
|
|
mod blog_post;
|
|
mod cli;
|
|
mod command;
|
|
mod config;
|
|
mod error;
|
|
mod render;
|
|
|
|
fn main() -> Result<ExitCode, CustomError> {
|
|
let rt = tokio::runtime::Runtime::new()?;
|
|
rt.block_on(async {
|
|
let main_body_result = main_body().await;
|
|
main_body_result
|
|
})
|
|
}
|
|
|
|
async fn main_body() -> Result<ExitCode, CustomError> {
|
|
let args = Cli::parse();
|
|
match args.command {
|
|
Commands::Init(args) => {
|
|
init_writer_folder(args).await?;
|
|
}
|
|
Commands::Build(args) => {
|
|
build_site(args).await?;
|
|
}
|
|
};
|
|
Ok(ExitCode::SUCCESS)
|
|
}
|