From f6e57fbf0b1242ad3069d45c815d79b9d68871a2 Mon Sep 17 00:00:00 2001 From: Au <134689569+auxiliarypower@users.noreply.github.com> Date: Fri, 29 Sep 2023 04:49:13 +0800 Subject: [PATCH] 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. --- utility/create-sha-file.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utility/create-sha-file.mjs b/utility/create-sha-file.mjs index d3590e779..dceba41d7 100644 --- a/utility/create-sha-file.mjs +++ b/utility/create-sha-file.mjs @@ -24,7 +24,7 @@ export default (async function (out, archiveFiles) { const filesToAnalyze = Array.from(new Set(archiveFiles.map(f => f.full))).sort(); let s = ""; 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); });