mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2024-11-22 04:06:21 +03:00
Fix no artifact property when downloading a library
This commit is contained in:
parent
e832e963f8
commit
6ca014dbba
1 changed files with 14 additions and 1 deletions
|
@ -509,7 +509,8 @@ class Handler {
|
|||
jarPath = path.join(directory, `${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}`)
|
||||
}
|
||||
|
||||
if (!fs.existsSync(path.join(jarPath, name)) || !this.checkSum(library.downloads.artifact.sha1, path.join(jarPath, name))) {
|
||||
// Fix no artifact property when downloading a library
|
||||
if (!fs.existsSync(path.join(jarPath, name))) {
|
||||
// Simple lib support, forgot which addon needed this but here you go, Mr special.
|
||||
if (library.url) {
|
||||
const url = `${library.url}${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}/${name}`
|
||||
|
@ -519,6 +520,18 @@ class Handler {
|
|||
}
|
||||
}
|
||||
|
||||
if(library.downloads){
|
||||
if(!this.checkSum(library.downloads.artifact.sha1, path.join(jarPath, name))){
|
||||
// Simple lib support, forgot which addon needed this but here you go, Mr special.
|
||||
if (library.url) {
|
||||
const url = `${library.url}${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}/${name}`
|
||||
await this.downloadAsync(url, jarPath, name, true, eventName)
|
||||
} else if (library.downloads && library.downloads.artifact) {
|
||||
await this.downloadAsync(library.downloads.artifact.url, jarPath, name, true, eventName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
counter++
|
||||
this.client.emit('progress', {
|
||||
type: eventName,
|
||||
|
|
Loading…
Add table
Reference in a new issue