Yield accessory

This commit is contained in:
David Heinemeier Hansson
2023-02-01 13:30:04 +01:00
parent e17a7e28cb
commit 00afd5c6fc

View File

@@ -93,13 +93,15 @@ class Mrsk::Cli::Accessory < Mrsk::Cli::Base
else raise "Unknown method: #{options[:method]}" else raise "Unknown method: #{options[:method]}"
end.inquiry end.inquiry
if runner.exec_over_ssh? with_accessory(name) do |accessory|
run_locally do if runner.exec_over_ssh?
info "Launching command on #{accessory.host}" run_locally do
exec accessory.exec_over_ssh(cmd, host: accessory.host) info "Launching command on #{accessory.host}"
exec accessory.exec_over_ssh(cmd, host: accessory.host)
end
else
on(accessory.host) { puts capture_with_info(*accessory.send(runner, cmd)) }
end end
else
on(accessory.host) { puts capture_with_info(*accessory.send(runner, cmd)) }
end end
end end