fix(utility): correct the format of generated hash values and file names (#2012)
Fix a bug in the utility/create-sha-file.mjs module that caused the generated hash values to have an incorrect format and the file names to be undefined. Use the file.name property instead of the file.base property to get the correct file name. Append the hash value before the file name, separated by a tab character, to match the expected format.
This commit is contained in:
parent
22e84a2208
commit
f6e57fbf0b
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ export default (async function (out, archiveFiles) {
|
||||||
const filesToAnalyze = Array.from(new Set(archiveFiles.map(f => f.full))).sort();
|
const filesToAnalyze = Array.from(new Set(archiveFiles.map(f => f.full))).sort();
|
||||||
let s = "";
|
let s = "";
|
||||||
for (const file of filesToAnalyze) {
|
for (const file of filesToAnalyze) {
|
||||||
s += `${file.base}\t${await hashFile(file)}\n`;
|
s += `${await hashFile(file)}\t${file.name}\n`;
|
||||||
}
|
}
|
||||||
await fs.promises.writeFile(out, s);
|
await fs.promises.writeFile(out, s);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue