From 461cf827a6b196e12a42bd3e1c7b59b5dc328042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A9=86=E5=AE=A2?= Date: Sat, 28 Apr 2018 19:01:21 +0800 Subject: [PATCH] sort alinode version when lookup --- tnvm.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tnvm.sh b/tnvm.sh index 3da979e..9d513c1 100755 --- a/tnvm.sh +++ b/tnvm.sh @@ -326,19 +326,15 @@ _tnvm_lookup_nodemap() { case "$PATTERN" in "alinode") mirror=$MIRROR_ALINODE ;; - "profiler") mirror=$MIRROR_PROFILER - ;; *) return 1 ;; esac NODEMAP="$(_tnvm_download -L -s "$mirror/index.tab" -o - \ - | command sed " - 1d; - s/^/$PATTERN-/;" \ - | command awk '{ print "Node.js upkeep release to provide "$1 " with Node.js " $10}' \ - | command grep -w "$PATTERN" \ - | command sort)" + | command awk '{ print $1 $10}' \ + | command awk -F "v" '{ print $2 " " $3}' \ + | command sort -t. -k 1,1n -k 2,2n \ + | command awk '{print "Node.js upkeep release to provide alinode-v"$1 " with Node.js v" $2}')" if [ -z "$NODEMAP" ]; then return 3