feat: throw an error if log4j file got changed

This commit is contained in:
HerozDotExe 2025-12-07 17:20:50 +01:00
parent 4c33ab960b
commit 37c2282052

View file

@ -18,13 +18,13 @@ export async function getArgument(
url: versionManifest.logging.client.file.url, url: versionManifest.logging.client.file.url,
path: xmlDestination, path: xmlDestination,
}); });
}
if ( if (
hash("sha1", await fs.readFile(xmlDestination, {encoding: "utf-8"})) !== hash("sha1", await fs.readFile(xmlDestination, { encoding: "utf-8" })) !==
versionManifest.logging.client.file.sha1 versionManifest.logging.client.file.sha1
) { ) {
throw new Error("Wrong hash for log4j's xml config"); throw new Error("Wrong hash for log4j's xml config");
}
} }
return versionManifest.logging.client.argument.replace( return versionManifest.logging.client.argument.replace(