Skip to content

Commit

Permalink
CHG: support -s option for console
Browse files Browse the repository at this point in the history
  • Loading branch information
snow committed Mar 21, 2015
1 parent 39f88d3 commit 3c51d22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/capistrano/rails/console/tasks/remote.cap
Expand Up @@ -23,7 +23,8 @@ namespace :rails do
user_host = [host.user, host.hostname].compact.join('@')
ssh_cmd = "ssh #{ssh_cmd_options_str} #{user_host} -p #{host.port || 22}"

cmd = SSHKit::Command.new(:rails, "console #{fetch(:rails_env)}", host: host)
sandbox_arg = ENV.key?('sandbox') || ENV.key?('s') ? '-s' : ''
cmd = SSHKit::Command.new(:rails, "console #{fetch(:rails_env)} #{sandbox_arg}", host: host)
SSHKit.config.output << cmd

exec(%Q(#{ssh_cmd} -t "cd #{current_path} && (#{cmd.environment_string} #{cmd})"))
Expand Down

0 comments on commit 3c51d22

Please sign in to comment.