module structure
cargo devel CI / cargo CI (push) Successful in 3m34s Details

This commit is contained in:
Christoph J. Scherr 2024-02-16 18:58:20 +01:00
parent 660d4bd9da
commit 2568d96ac3
Signed by: PlexSheep
GPG Key ID: 7CDD0B14851A08EF
6 changed files with 19 additions and 5 deletions

View File

@ -156,7 +156,7 @@ impl Debug for Config {
}
impl Config {
pub fn load(cli: Cli) -> Result<Self> {
pub fn load(cli: &Cli) -> Result<Self> {
let repo = match git2::Repository::open_from_env() {
Ok(repo) => repo,
Err(_err) => {
@ -197,7 +197,7 @@ impl Config {
yaml,
repo,
path,
cli,
cli: cli.clone(),
})
}
}

View File

@ -1,3 +1,6 @@
pub mod changelog;
pub mod publish;
pub mod serverapi;
pub mod release;
pub mod config;
pub mod error;

View File

@ -4,23 +4,25 @@ use autocrate::{
cli::{Cli, Commands},
Config,
},
release::release,
publish::publish,
error::*,
};
#[tokio::main]
async fn main() -> Result<()> {
let cli = Cli::cli_parse();
let cfg = Config::load(cli.clone())?;
let cfg = Config::load(&cli)?;
match cli.command {
Commands::Changelog { .. } => {
println!("{}", Changelog::build(&cfg)?);
}
Commands::Release { .. } => {
todo!()
release(&cfg)?;
}
Commands::Publish { .. } => {
todo!()
publish(&cfg)?;
}
};
Ok(())

4
src/publish/mod.rs Normal file
View File

@ -0,0 +1,4 @@
use crate::{config::Config, error::*};
pub fn publish(cfg: &Config) -> Result<()> {
todo!()
}

5
src/release/mod.rs Normal file
View File

@ -0,0 +1,5 @@
use crate::{config::Config, error::*};
pub fn release(cfg: &Config) -> Result<()> {
todo!()
}

0
src/serverapi/mod.rs Normal file
View File