tv elm-package-proxy: list newest packages first

This commit is contained in:
tv 2020-11-23 15:54:13 +01:00
parent 5b455f5cca
commit f9e11a9648

View File

@ -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>[^/]+)$";"\(.author)/\(.pname)@\(.version)")
)
) |
sort_by(split("@") | [.[0]]+(.[1]|split("."))) |
reverse
'
)