Permalink
Browse files

Merge pull request #39 from yyyc514/master

redirect STDERR since some software prints its version to STDERR instead of STDOUT - fixes #30
  • Loading branch information...
2 parents e4fdd28 + 8825ac4 commit 948c89d844a3dc68f4f4f30678398d2f8ae08e7e @crafterm committed Sep 18, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/sprinkle/verifiers/executable.rb
@@ -37,7 +37,7 @@ def has_executable(path)
# defaults to "-v").
def has_executable_with_version(path, version, get_version = '-v')
if path.include?('/')
- @commands << "[ -x #{path} -a -n \"`#{path} #{get_version} 2> /dev/null | egrep -e \\\"#{version}\\\"`\" ]"
+ @commands << "[ -x #{path} -a -n \"`#{path} #{get_version} 2>&1 | egrep -e \\\"#{version}\\\"`\" ]"
else
@commands << "[ -n \"`echo \\`which #{path}\\``\" -a -n \"`\\`which #{path}\\` #{get_version} 2>&1 | egrep -e \\\"#{version}\\\"`\" ]"
end

0 comments on commit 948c89d

Please sign in to comment.