1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-24 23:00:09 +00:00

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

View file

@ -89,7 +89,7 @@ require_tool ()
envvar_name=$(echo $1 | tr '[:lower:]' '[:upper:]') envvar_name=$(echo $1 | tr '[:lower:]' '[:upper:]')
tool=$(printenv $envvar_name || echo $1) tool=$(printenv $envvar_name || echo $1)
local version=$($tool --version 2>/dev/null| \ 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 if test x"$version" = x ; then
echo "$tool is required" >/dev/stderr echo "$tool is required" >/dev/stderr
return 1 return 1