mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Merge pull request #265 from nutznboltz/issue-251
Can't use sudo as an argument in cap shell command
This commit is contained in:
commit
2fe158fc9e
1 changed files with 1 additions and 1 deletions
|
@ -174,7 +174,7 @@ HELP
|
||||||
|
|
||||||
# Execute a command on the given list of servers.
|
# Execute a command on the given list of servers.
|
||||||
def exec_command(command, servers)
|
def exec_command(command, servers)
|
||||||
command = command.gsub(/\bsudo\b/, "sudo -p '#{configuration.sudo_prompt}'")
|
command = command.gsub(/^(\s*)sudo\b|([|;&])\s*sudo\b/, "\\0 -p '#{configuration.sudo_prompt}'")
|
||||||
processor = configuration.sudo_behavior_callback(Configuration.default_io_proc)
|
processor = configuration.sudo_behavior_callback(Configuration.default_io_proc)
|
||||||
sessions = servers.map { |server| configuration.sessions[server] }
|
sessions = servers.map { |server| configuration.sessions[server] }
|
||||||
options = configuration.add_default_command_options({})
|
options = configuration.add_default_command_options({})
|
||||||
|
|
Loading…
Reference in a new issue