Apply suggestions from code review
Co-authored-by: Donal McBreen <dmcbreen@gmail.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
class Kamal::Cli::Server < Kamal::Cli::Base
|
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)"
|
option :interactive, type: :boolean, aliases: "-i", default: false, desc: "Run the command interactively(use for console/bash)"
|
||||||
def exec(cmd)
|
def exec(cmd)
|
||||||
hosts = KAMAL.hosts | KAMAL.accessory_hosts
|
hosts = KAMAL.hosts | KAMAL.accessory_hosts
|
||||||
|
|
||||||
case
|
case
|
||||||
when options[:interactive]
|
when options[:interactive]
|
||||||
host = hosts.first
|
host = KAMAL.primary_host
|
||||||
|
|
||||||
say "Running '#{cmd}' on #{host} interactively...", :magenta
|
say "Running '#{cmd}' on #{host} interactively...", :magenta
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user