Add remote_topgrade_path configuration option
This commit is contained in:
@@ -253,10 +253,12 @@ pub fn run_composer_update(ctx: &ExecutionContext) -> Result<()> {
|
||||
pub fn run_remote_topgrade(ctx: &ExecutionContext, hostname: &str) -> Result<()> {
|
||||
let ssh = utils::require("ssh")?;
|
||||
|
||||
let topgrade = ctx.config().remote_topgrade_path();
|
||||
|
||||
if ctx.config().run_in_tmux() && !ctx.run_type().dry() {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
crate::tmux::run_remote_topgrade(hostname, &ssh, ctx.config().tmux_arguments())?;
|
||||
crate::tmux::run_remote_topgrade(hostname, &ssh, topgrade, ctx.config().tmux_arguments())?;
|
||||
Err(SkipStep.into())
|
||||
}
|
||||
|
||||
@@ -270,7 +272,7 @@ pub fn run_remote_topgrade(ctx: &ExecutionContext, hostname: &str) -> Result<()>
|
||||
}
|
||||
|
||||
let env = format!("TOPGRADE_PREFIX={}", hostname);
|
||||
args.extend(&["env", &env, "topgrade"]);
|
||||
args.extend(&["env", &env, topgrade]);
|
||||
|
||||
if ctx.config().yes() {
|
||||
args.push("-y");
|
||||
|
||||
@@ -104,11 +104,12 @@ pub fn run_in_tmux(args: &Option<String>) -> ! {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn run_remote_topgrade(hostname: &str, ssh: &Path, tmux_args: &Option<String>) -> Result<()> {
|
||||
pub fn run_remote_topgrade(hostname: &str, ssh: &Path, topgrade: &str, tmux_args: &Option<String>) -> Result<()> {
|
||||
let command = format!(
|
||||
"{ssh} -t {hostname} env TOPGRADE_PREFIX={hostname} TOPGRADE_KEEP_END=1 topgrade",
|
||||
"{ssh} -t {hostname} env TOPGRADE_PREFIX={hostname} TOPGRADE_KEEP_END=1 {topgrade}",
|
||||
ssh = ssh.display(),
|
||||
hostname = hostname
|
||||
hostname = hostname,
|
||||
topgrade = topgrade
|
||||
);
|
||||
Tmux::new(tmux_args)
|
||||
.build()
|
||||
|
||||
Reference in New Issue
Block a user