feature/dry-run (#43)
Co-authored-by: kjuulh <contact@kjuulh.io> Reviewed-on: #43
This commit is contained in:
@@ -63,6 +63,7 @@ pub fn execute_cmd() -> Command {
|
||||
.long("dry-run")
|
||||
.action(ArgAction::Set)
|
||||
.env("OCTOPUSH_DRY_RUN")
|
||||
.default_value("true")
|
||||
.required(false),
|
||||
)
|
||||
}
|
||||
@@ -78,7 +79,14 @@ pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
|
||||
|
||||
let github_http_token = args.get_one::<String>("github-api-token");
|
||||
let github_username = args.get_one::<String>("github-username");
|
||||
let dryrun = args.get_one::<bool>("dry-run").unwrap_or(&false).clone();
|
||||
let dryrun: bool = args
|
||||
.get_one::<String>("dry-run")
|
||||
.ok_or(eyre::anyhow!("--dry-run is required"))?
|
||||
.parse()?;
|
||||
|
||||
if dryrun {
|
||||
tracing::info!("running in dry-run mode");
|
||||
}
|
||||
|
||||
let service_register = ServiceRegister::new(
|
||||
LocalGitProviderOptions { http_auth: None },
|
||||
|
@@ -43,7 +43,7 @@ impl GitSelector {
|
||||
self.executor.execute(&path, action_path, action).await?;
|
||||
|
||||
if dryrun {
|
||||
return Ok(());
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Some(push) = &git.push {
|
||||
|
@@ -49,7 +49,7 @@ impl GiteaSelector {
|
||||
self.executor.execute(&path, action_path, action).await?;
|
||||
|
||||
if dryrun {
|
||||
return Ok(());
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Some(push) = &git.push {
|
||||
|
@@ -49,7 +49,7 @@ impl GitHubSelector {
|
||||
self.executor.execute(&path, action_path, action).await?;
|
||||
|
||||
if dryrun {
|
||||
return Ok(());
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Some(push) = &git.push {
|
||||
|
Reference in New Issue
Block a user