run(command, config = {})
public
Executes a command returning the contents of the command.
Parameters
command |
the command to be executed.
|
config |
give :verbose => false to not log the status, :capture => true to hide to
output. Specify :with to append an executable to command execution.
|
Example
inside('vendor') do
run('ln -s ~/edge rails')
end
# File lib/bundler/vendor/thor/lib/thor/actions.rb, line 242
def run(command, config = {})
return unless behavior == :invoke
destination = relative_to_original_destination_root(destination_root, false)
desc = "#{command} from #{destination.inspect}"
if config[:with]
desc = "#{File.basename(config[:with].to_s)} #{desc}"
command = "#{config[:with]} #{command}"
end
say_status :run, desc, config.fetch(:verbose, true)
unless options[:pretend]
config[:capture] ? `#{command}` : system(command.to_s)
end
end