execute_command(executor, command, options = {})
private
Runs the supplied command using either “rake …” or “rails
…” based on the executor parameter provided.
# File railties/lib/rails/generators/actions.rb, line 293
def execute_command(executor, command, options = {}) # :doc:
log executor, command
env = options[:env] || ENV["RAILS_ENV"] || "development"
sudo = options[:sudo] && !Gem.win_platform? ? "sudo " : ""
config = { verbose: false }
config.merge!(capture: options[:capture]) if options[:capture]
in_root { run("#{sudo}#{extify(executor)} #{command} RAILS_ENV=#{env}", config) }
end