Changeset 7388
- Timestamp:
- 09/01/07 03:31:53 (10 months ago)
- Files:
-
- tools/capistrano/CHANGELOG (modified) (1 diff)
- tools/capistrano/lib/capistrano/command.rb (modified) (1 diff)
- tools/capistrano/test/command_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/capistrano/CHANGELOG
r7387 r7388 1 1 *SVN* 2 3 * Set :shell to false to run a command without wrapping it in "sh -c" [Jamis Buck] 2 4 3 5 * Don't request a pty by default [Jamis Buck] tools/capistrano/lib/capistrano/command.rb
r7387 r7388 87 87 execute_command = Proc.new do |ch| 88 88 logger.trace "executing command", ch[:server] if logger 89 escaped = replace_placeholders(command, ch).gsub(/[$\\`"]/) { |m| "\\#{m}" } 90 command_line = [environment, options[:shell] || "sh", "-c", "\"#{escaped}\""].compact.join(" ") 89 cmd = replace_placeholders(command, ch) 90 91 if options[:shell] == false 92 shell = nil 93 else 94 shell = "#{options[:shell] || "sh"} -c" 95 cmd = cmd.gsub(/[$\\`"]/) { |m| "\\#{m}" } 96 cmd = "\"#{cmd}\"" 97 end 98 99 command_line = [environment, shell, cmd].compact.join(" ") 100 91 101 ch.exec(command_line) 92 102 ch.send_data(options[:data]) if options[:data] tools/capistrano/test/command_test.rb
r7387 r7388 111 111 end 112 112 Capistrano::Command.new("ls", [session], :shell => "/bin/bash") 113 end 114 115 def test_successful_channel_with_shell_false_should_send_command_without_shell 116 session = setup_for_extracting_channel_action do |ch| 117 ch.expects(:exec).with(%(echo `hostname`)) 118 end 119 Capistrano::Command.new("echo `hostname`", [session], :shell => false) 113 120 end 114 121