Apply suggestions from code review

Co-authored-by: Donal McBreen <dmcbreen@gmail.com>
This commit is contained in:
Nick Hammond
2024-05-20 11:15:14 -07:00
committed by GitHub
parent fb58fc0ba6
commit 8a4f7163bb

View File

@@ -1,12 +1,12 @@
class Kamal::Cli::Server < Kamal::Cli::Base
desc "exec", "Run a custom command on the server(use --help to show options)"
desc "exec", "Run a custom command on the server (use --help to show options)"
option :interactive, type: :boolean, aliases: "-i", default: false, desc: "Run the command interactively(use for console/bash)"
def exec(cmd)
hosts = KAMAL.hosts | KAMAL.accessory_hosts
case
when options[:interactive]
host = hosts.first
host = KAMAL.primary_host
say "Running '#{cmd}' on #{host} interactively...", :magenta