Added checksum for library download operation (#110)

This commit is contained in:
Miate 2023-05-22 14:52:30 -07:00 committed by GitHub
parent 1fa4668de9
commit acdaac526d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -509,7 +509,7 @@ class Handler {
jarPath = path.join(directory, `${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}`) jarPath = path.join(directory, `${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}`)
} }
if (!fs.existsSync(path.join(jarPath, name))) { if (!fs.existsSync(path.join(jarPath, name)) || !this.checkSum(library.downloads.artifact.sha1, path.join(jarPath, name))) {
// Simple lib support, forgot which addon needed this but here you go, Mr special. // Simple lib support, forgot which addon needed this but here you go, Mr special.
if (library.url) { if (library.url) {
const url = `${library.url}${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}/${name}` const url = `${library.url}${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}/${name}`