Permalink
Browse files

redirect STDERR since some software prints its version to STDERR inst…

…ead of STDOUT - fixes #30
  • Loading branch information...
1 parent e4fdd28 commit 8825ac4a63e9bbd7fb855573c0bcea00709bf1c0 @yyyc514 yyyc514 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 8825ac4

Please sign in to comment.