4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/bard/cli/run.rb', line 4
def self.included mod
mod.class_eval do
original_verbose, $VERBOSE = $VERBOSE, nil
Thor::THOR_RESERVED_WORDS -= ["run"]
$VERBOSE = original_verbose
option :target, type: :string, default: "production"
option :home, type: :boolean
desc "run <command>", "run the given command on the specified target"
def run *args
target = config[options[:target].to_sym]
target.run! *args.join(" "), verbose: true, home: options[:home]
rescue Bard::Command::Error => e
puts red("!!! ") + "Running command failed: #{yellow(e.message)}"
exit 1
end
end
end
|