From 2fd737f0bb68318eba8476d26dcdd72f18f91261 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 7 May 2024 14:01:23 +0100 Subject: [PATCH] Fix sort order --- scripts/generate-packages-index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/generate-packages-index.ts b/scripts/generate-packages-index.ts index 046cd9f..b7b353d 100755 --- a/scripts/generate-packages-index.ts +++ b/scripts/generate-packages-index.ts @@ -187,8 +187,9 @@ async function generateIndex(Prefix: string): Promise<{ } while (continuationToken); console.info(`Got ${files.length} files and ${dirs.length} directories over ${page} pages`); - // Reverse files to have latest at the top - const Body = indexLayout(Prefix, files.reverse(), dirs); + files.sort((a, b) => b.LastModified!.getTime() - a.LastModified!.getTime()); + + const Body = indexLayout(Prefix, files, dirs); await client.send( new PutObjectCommand({