Remove dupes in the SHA file

This commit is contained in:
be5invis 2023-07-10 23:20:09 -07:00
parent f7a80d60d2
commit c65131ecd3

View file

@ -21,9 +21,10 @@ function hashFile(path) {
});
}
export default (async function (out, archiveFiles) {
const filesToAnalyze = Array.from(new Set(archiveFiles.map(f => f.full))).sort;
let s = "";
for (const file of archiveFiles) {
s += `${file.base}\t${await hashFile(file.full)}\n`;
for (const file of filesToAnalyze) {
s += `${file.base}\t${await hashFile(file)}\n`;
}
await fs.promises.writeFile(out, s);
});