Selective yes (fix #802) (#808)

* Selective yes flag (fix #802)

* Selective yes flag (fix #802)

* selective yes

* MacOS
This commit is contained in:
Roey Darwish Dror
2021-12-06 14:44:20 +02:00
committed by GitHub
parent 4b8cf641a1
commit ab3ff0ecae
11 changed files with 77 additions and 59 deletions

View File

@@ -1,6 +1,7 @@
use crate::{error::SkipStep, execution_context::ExecutionContext, terminal::print_separator, utils};
use anyhow::Result;
use crate::{error::SkipStep, execution_context::ExecutionContext, terminal::print_separator, utils};
fn prepare_async_ssh_command(args: &mut Vec<&str>) {
args.insert(0, "ssh");
args.push("--keep");
@@ -19,10 +20,6 @@ pub fn ssh_step(ctx: &ExecutionContext, hostname: &str) -> Result<()> {
let env = format!("TOPGRADE_PREFIX={}", hostname);
args.extend(&["env", &env, "$SHELL", "-lc", topgrade]);
if ctx.config().yes() {
args.push("-y");
}
if ctx.config().run_in_tmux() && !ctx.run_type().dry() {
#[cfg(unix)]
{
@@ -47,10 +44,6 @@ pub fn ssh_step(ctx: &ExecutionContext, hostname: &str) -> Result<()> {
let env = format!("TOPGRADE_PREFIX={}", hostname);
args.extend(&["env", &env, "$SHELL", "-lc", topgrade]);
if ctx.config().yes() {
args.push("-y");
}
print_separator(format!("Remote ({})", hostname));
println!("Connecting to {}...", hostname);