Skip to content

Commit

Permalink
(MODULES-1582) Improve % detection
Browse files Browse the repository at this point in the history
Avoids any validate commands that have %'s in them other than "... % ..."
  • Loading branch information
Peter Souter committed Dec 18, 2014
1 parent cc8b147 commit b3d007f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet/parser/functions/validate_cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module Puppet::Parser::Functions
tmpfile.write(content)
tmpfile.close

if checkscript.include?('%')
if checkscript =~ /\s%(\s|$)/
check_with_correct_location = checkscript.gsub(/%/,tmpfile.path)
else
check_with_correct_location = "#{checkscript} #{tmpfile.path}"
Expand Down

0 comments on commit b3d007f

Please sign in to comment.