Skip to content

Commit

Permalink
Fix sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed May 7, 2024
1 parent fc90031 commit 2fd737f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/generate-packages-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 2fd737f

Please sign in to comment.