1
0
Fork 0
mirror of https://gitlab.com/ydkn/capistrano-rails-console.git synced 2023-02-13 20:54:14 -05:00

use command map directly

This commit is contained in:
Florian Schwab 2015-07-28 16:26:26 +02:00
parent 2440233d72
commit 7656037519

View file

@ -22,9 +22,9 @@ namespace :rails do
rails_console_args << '--sandbox' if ENV.key?('sandbox') || ENV.key?('s') rails_console_args << '--sandbox' if ENV.key?('sandbox') || ENV.key?('s')
rails_env = fetch(:rails_env, fetch(:stage, 'production')) rails_env = fetch(:rails_env, fetch(:stage, 'production'))
bundle_mapped = SSHKit.config.command_map.prefix[:bundle] rescue nil bundle_cmd = (SSHKit.config.command_map[:bundle] rescue nil) || :bundle
cmd = SSHKit::Command.new(((bundle_mapped.first + ' bundle') rescue :bundle), :exec, :rails, :console, rails_env, *rails_console_args, host: host) cmd = SSHKit::Command.new(bundle_cmd, :exec, :rails, :console, rails_env, *rails_console_args, host: host)
SSHKit.config.output << cmd SSHKit.config.output << cmd
port = host.port || (host.ssh_options || {})[:port] port = host.port || (host.ssh_options || {})[:port]