Version 0.5.0: Many improvements #8

Merged
cadey merged 5 commits from refactor-git-mod into main 2020-07-09 19:25:58 +00:00
5 changed files with 17 additions and 18 deletions
Showing only changes of commit d5b7b59e3e - Show all commits

View File

@ -2,7 +2,7 @@ use crate::{changelog, cmd::*, git, version};
use anyhow::Result;
use std::path::PathBuf;
pub(crate) async fn run(
pub async fn run(
common: Common,
fname: PathBuf,
tag: Option<String>,

View File

@ -3,7 +3,7 @@ use anyhow::Result;
use git2::Repository;
use url::Url;
pub(crate) async fn run(env: DroneEnv) -> Result<()> {
pub async fn run(env: DroneEnv) -> Result<()> {
let common: Common = env.clone().into();
let default_branch = {

View File

@ -1,11 +1,11 @@
use std::path::PathBuf;
use structopt::StructOpt;
pub(crate) mod cut;
pub(crate) mod drone_plugin;
pub mod cut;
pub mod drone_plugin;
#[derive(StructOpt, Debug, Clone)]
pub(crate) struct Common {
pub struct Common {
/// The gitea server to connect to
#[structopt(short, long, env = "GITEA_SERVER")]
pub server: String,
@ -36,7 +36,7 @@ pub(crate) struct Common {
}
#[derive(StructOpt, Debug, Clone)]
pub(crate) struct DroneEnv {
pub struct DroneEnv {
// Given by drone
/// push URL
#[structopt(long, env = "DRONE_GIT_HTTP_URL")]
@ -99,7 +99,7 @@ impl Into<Common> for DroneEnv {
}
#[derive(StructOpt, Debug)]
pub(crate) struct ReleaseMeta {
pub struct ReleaseMeta {
/// Release name
#[structopt(short, long)]
pub name: Option<String>,
@ -113,7 +113,7 @@ pub(crate) struct ReleaseMeta {
#[derive(StructOpt, Debug)]
#[structopt(about = "Gitea release assistant")]
pub(crate) enum Cmd {
pub enum Cmd {
/// Create a new tag and release on Gitea
#[structopt(alias = "release")]
Cut {

8
src/lib.rs Normal file
View File

@ -0,0 +1,8 @@
pub mod changelog;
pub mod cmd;
pub mod git;
pub mod version;
// Name your user agent after your app?
pub static APP_USER_AGENT: &str =
concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));

View File

@ -1,16 +1,7 @@
use anyhow::Result;
use structopt::StructOpt;
mod changelog;
mod cmd;
mod git;
mod version;
pub(crate) use cmd::*;
// Name your user agent after your app?
pub(crate) static APP_USER_AGENT: &str =
concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));
use ::gitea_release::{cmd::{self, Cmd}};
#[tokio::main]
async fn main() -> Result<()> {