From f9e11a96488d5404cab04244b044d7be371eb45e Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 23 Nov 2020 15:54:13 +0100 Subject: tv elm-package-proxy: list newest packages first --- tv/2configs/elm-packages-proxy.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tv') diff --git a/tv/2configs/elm-packages-proxy.nix b/tv/2configs/elm-packages-proxy.nix index bc471a32..cc1e119c 100644 --- a/tv/2configs/elm-packages-proxy.nix +++ b/tv/2configs/elm-packages-proxy.nix @@ -165,7 +165,6 @@ in { ;; 'POST /all-packages/since/'*) - # TODO only show newest? my_packages=$( cd ${cfg.packageDir} find -mindepth 3 -maxdepth 3 | @@ -174,7 +173,9 @@ in { map( select(.!="") | sub("^\\./(?[^/]+)/(?[^/]+)/(?[^/]+)$";"\(.author)/\(.pname)@\(.version)") - ) + ) | + sort_by(split("@") | [.[0]]+(.[1]|split("."))) | + reverse ' ) -- cgit v1.2.3