Skip to content

Commit

Permalink
Change regular expression for adding sudo with exclamation.
Browse files Browse the repository at this point in the history
  • Loading branch information
a3no committed Jul 22, 2013
1 parent d9688e0 commit d27be6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/serverspec/backend/ssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def build_command(cmd)
cmd = super(cmd)
if RSpec.configuration.ssh.options[:user] != 'root'
cmd = "sudo #{cmd}"
cmd.gsub!(/(\&\&\s*\(?)/, "\\1sudo ")
cmd.gsub!(/(\|\|\s*\(?)/, "\\1sudo ")
cmd.gsub!(/(\&\&\s*!*\s*\(?)/, "\\1sudo ")
cmd.gsub!(/(\|\|\s*!*\s*\(?)/, "\\1sudo ")
end
cmd
end
Expand Down

0 comments on commit d27be6f

Please sign in to comment.