generated from PlexSheep/rs-base
module structure
cargo devel CI / cargo CI (push) Successful in 3m34s
Details
cargo devel CI / cargo CI (push) Successful in 3m34s
Details
This commit is contained in:
parent
660d4bd9da
commit
2568d96ac3
|
@ -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(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
pub mod changelog;
|
||||
pub mod publish;
|
||||
pub mod serverapi;
|
||||
pub mod release;
|
||||
pub mod config;
|
||||
pub mod error;
|
||||
|
|
|
@ -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(())
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
use crate::{config::Config, error::*};
|
||||
pub fn publish(cfg: &Config) -> Result<()> {
|
||||
todo!()
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
use crate::{config::Config, error::*};
|
||||
|
||||
pub fn release(cfg: &Config) -> Result<()> {
|
||||
todo!()
|
||||
}
|
Loading…
Reference in New Issue