Skip to content

Commit

Permalink
add csv sort script (unused)
Browse files Browse the repository at this point in the history
  • Loading branch information
sterlingwes committed Feb 10, 2024
1 parent 9e23eaf commit f3b2687
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/utils/sort-csv.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import fs from "fs";

export const sortCsv = (repoFilePath: string) => {
const csv = fs.readFileSync(repoFilePath).toString();
const sortedRows = csv.split("\n").sort((a, b) => {
return a.localeCompare(b);
});

fs.writeFileSync(repoFilePath, sortedRows.join("\n"));
};

0 comments on commit f3b2687

Please sign in to comment.