0
0
mirror of https://github.com/tj/n.git synced 2024-11-25 15:49:24 +01:00

Merge pull request #371 from MiniGod/only-major-version

Resolve versions with no dots
This commit is contained in:
Nimit Kalra 2016-09-10 00:19:24 -05:00 committed by GitHub
commit 61480e2db3

2
bin/n
View File

@ -500,7 +500,7 @@ install() {
local version=${1#v}
local dots=$(echo $version | sed 's/[^.]*//g')
if test ${#dots} -eq 1; then
if test ${#dots} -lt 2; then
version=$($GET 2> /dev/null ${MIRROR[DEFAULT]} \
| egrep "</a>" \
| egrep -o '[0-9]+\.[0-9]+\.[0-9]+' \