cap-pack/lib/cap-pack.rb

19 lines
591 B
Ruby
Raw Normal View History

2012-06-08 19:39:24 +00:00
Capistrano::Configuration.instance.load do
_cset(:user_shell_method) { %{bash -l -c} }
def tty_ssh_command_in_current_host(command, hostname = current_host)
user_ssh_command = fetch(:user, nil) ? "-l #{fetch(:user)}" : ''
2012-06-27 13:47:49 +00:00
user_ssh_command << " #{ENV['SSH_OPTS']}" if ENV['SSH_OPTS']
2012-06-08 21:08:03 +00:00
exec %{ssh #{user_ssh_command} #{hostname} -t "#{user_shell_method} 'cd #{current_path} && #{command}'"}
2012-06-08 19:39:24 +00:00
end
def current_host
ENV['HOST'] || find_servers_for_task(current_task).first
2012-06-08 19:39:24 +00:00
end
Dir[File.expand_path('../cap-pack/recipes/**/*.rb', __FILE__)].each { |f| load f }
end