Expose ssh_run

This commit is contained in:
David Heinemeier Hansson
2023-02-01 14:04:51 +01:00
parent 1840f667d3
commit 71f8f164ca
3 changed files with 18 additions and 10 deletions

View File

@@ -63,6 +63,10 @@ class Mrsk::Commands::Accessory < Mrsk::Commands::Base
*command
end
def run_over_ssh(command)
super command, host: host
end
def exec_over_ssh(*command)
run_over_ssh run_exec(*command, interactive: true).join(" "), host: host
end

View File

@@ -8,6 +8,10 @@ module Mrsk::Commands
@config = config
end
def run_over_ssh(command, host:)
"ssh -t #{config.ssh_user}@#{host} '#{command}'"
end
private
def combine(*commands, by: "&&")
commands
@@ -27,9 +31,5 @@ module Mrsk::Commands
def docker(*args)
args.compact.unshift :docker
end
def run_over_ssh(command, host:)
"ssh -t #{config.ssh_user}@#{host} '#{command}'"
end
end
end