feat: add auto-push functionality to commit and tag commands
This commit is contained in:
@@ -158,11 +158,22 @@ impl TagCommand {
|
||||
|
||||
println!("{} {}", messages.tag_created().green(), tag_name.cyan());
|
||||
|
||||
// Push if requested
|
||||
// Push if requested or ask user
|
||||
if self.push {
|
||||
println!("{}", messages.pushing_tag(&self.remote));
|
||||
repo.push(&self.remote, &format!("refs/tags/{}", tag_name))?;
|
||||
println!("{}", messages.pushed_tag(&self.remote));
|
||||
} else if !self.yes && !self.dry_run {
|
||||
let should_push = Confirm::new()
|
||||
.with_prompt(messages.push_after_tag())
|
||||
.default(false)
|
||||
.interact()?;
|
||||
|
||||
if should_push {
|
||||
println!("{}", messages.pushing_tag(&self.remote));
|
||||
repo.push(&self.remote, &format!("refs/tags/{}", tag_name))?;
|
||||
println!("{}", messages.pushed_tag(&self.remote));
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user