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 {
|
impl Config {
|
||||||
pub fn load(cli: Cli) -> Result<Self> {
|
pub fn load(cli: &Cli) -> Result<Self> {
|
||||||
let repo = match git2::Repository::open_from_env() {
|
let repo = match git2::Repository::open_from_env() {
|
||||||
Ok(repo) => repo,
|
Ok(repo) => repo,
|
||||||
Err(_err) => {
|
Err(_err) => {
|
||||||
|
@ -197,7 +197,7 @@ impl Config {
|
||||||
yaml,
|
yaml,
|
||||||
repo,
|
repo,
|
||||||
path,
|
path,
|
||||||
cli,
|
cli: cli.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
pub mod changelog;
|
pub mod changelog;
|
||||||
|
pub mod publish;
|
||||||
|
pub mod serverapi;
|
||||||
|
pub mod release;
|
||||||
pub mod config;
|
pub mod config;
|
||||||
pub mod error;
|
pub mod error;
|
||||||
|
|
|
@ -4,23 +4,25 @@ use autocrate::{
|
||||||
cli::{Cli, Commands},
|
cli::{Cli, Commands},
|
||||||
Config,
|
Config,
|
||||||
},
|
},
|
||||||
|
release::release,
|
||||||
|
publish::publish,
|
||||||
error::*,
|
error::*,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
let cli = Cli::cli_parse();
|
let cli = Cli::cli_parse();
|
||||||
let cfg = Config::load(cli.clone())?;
|
let cfg = Config::load(&cli)?;
|
||||||
|
|
||||||
match cli.command {
|
match cli.command {
|
||||||
Commands::Changelog { .. } => {
|
Commands::Changelog { .. } => {
|
||||||
println!("{}", Changelog::build(&cfg)?);
|
println!("{}", Changelog::build(&cfg)?);
|
||||||
}
|
}
|
||||||
Commands::Release { .. } => {
|
Commands::Release { .. } => {
|
||||||
todo!()
|
release(&cfg)?;
|
||||||
}
|
}
|
||||||
Commands::Publish { .. } => {
|
Commands::Publish { .. } => {
|
||||||
todo!()
|
publish(&cfg)?;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Ok(())
|
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