From ee983aae74572281d92c7ed3ba5633c40d6cda6b Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 22 Nov 2023 17:35:44 -0600 Subject: [PATCH] Reverse sort --- scripts/publish-app-record.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/publish-app-record.sh b/scripts/publish-app-record.sh index 412686e..1f94a8b 100755 --- a/scripts/publish-app-record.sh +++ b/scripts/publish-app-record.sh @@ -26,7 +26,7 @@ services: fees: 200000aphoton EOF -next_ver=$(laconic -c $CONFIG_FILE cns record list --type ApplicationRecord --all --name "$rcd_name" 2>/dev/null | jq -r '.[0].attributes.version' | awk -F. -v OFS=. '{$NF += 1 ; print}') +next_ver=$(laconic -c $CONFIG_FILE cns record list --type ApplicationRecord --all --name "$rcd_name" 2>/dev/null | jq -s '.[] | sort_by(.createTime) | reverse' | jq -r '.[0].attributes.version' | awk -F. -v OFS=. '{$NF += 1 ; print}') cat < "$RECORD_FILE" record: