Fix version parsing. Now working with command $ zsh --version

This commit is contained in:
Tristan Carel 2011-04-13 17:24:44 +02:00
parent ca4dabb45e
commit bbf1f87ee6
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ require_tool ()
envvar_name=$(echo $1 | tr '[:lower:]' '[:upper:]')
tool=$(printenv $envvar_name || echo $1)
local version=$($tool --version 2>/dev/null| \
sed -n 's/.*[^0-9.]\([0-9][0-9.]*\).*/\1/p;q')
sed -n 's/.*[^0-9.]\([0-9]*\.[0-9.]*\).*/\1/p;q')
if test x"$version" = x ; then
echo "$tool is required" >/dev/stderr
return 1