From 9e4417291875b0fd7a88736602acb114306e89dd Mon Sep 17 00:00:00 2001 From: acecode Date: Sat, 10 Nov 2018 04:09:13 +0800 Subject: [PATCH] feat(ls-remote): list in number increase order add sort params to list versions in a correct number increase order remove useless `grep` step --- tnvm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tnvm.sh b/tnvm.sh index 3da979e..eedacd6 100755 --- a/tnvm.sh +++ b/tnvm.sh @@ -361,10 +361,10 @@ _tnvm_ls_remote() { VERSIONS="$(_tnvm_download -L -s "$mirror/index.tab" -o - \ | command sed " 1d; - s/^/$PATTERN-/; s/[[:blank:]].*//" \ - | command grep -w "$PATTERN" \ - | command sort)" + | command sort -t . -k 1.2n -k 2n -k 3n \ + | command sed "s/^/$PATTERN-/;" \ + )" if [ -z "$VERSIONS" ]; then echo "N/A"