Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #128 from richmeyers/command-normalization-fix

Enclose command in braces when normalizing it.
  • Loading branch information...
commit f57b041ab9094e95758de39af19f44ab194870fc 2 parents 861c6ad + 88800dd
@grahamc grahamc authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/integrity/command_runner.rb
View
10 lib/integrity/command_runner.rb
@@ -40,10 +40,16 @@ def run!(command)
end
def normalize(cmd)
+ # bash requires lists to end with a semicolon (or a newline).
+ # see http://wiki.bash-hackers.org/syntax/ccmd/grouping_plain
+ # zsh has no such restriction.
+ unless cmd[-1] == ?;
+ cmd += ';'
+ end
if @dir
- "(cd #{@dir} && #{cmd} 2>&1)"
+ "cd #{@dir} && { #{cmd} } 2>&1"
else
- "(#{cmd} 2>&1)"
+ "{ #{cmd} } 2>&1"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.