Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
bbf1f87e
Commit
bbf1f87e
authored
Apr 13, 2011
by
Tristan Carel
Browse files
Fix version parsing. Now working with command $ zsh --version
parent
ca4dabb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/require_tool.sh
View file @
bbf1f87e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment