mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2024-11-22 20:26:22 +03:00
14 lines
503 B
JavaScript
14 lines
503 B
JavaScript
|
const path = require('path');
|
||
|
const zip = require('adm-zip');
|
||
|
|
||
|
module.exports.extractPackage = function(root, clientPackage) {
|
||
|
return new Promise(async resolve => {
|
||
|
if(clientPackage.startsWith('http')) {
|
||
|
await downloadAsync(clientPackage, root, "clientPackage.zip");
|
||
|
clientPackage = path.join(root, "clientPackage.zip")
|
||
|
}
|
||
|
new zip(clientPackage).extractAllTo(root, true);
|
||
|
this.client.emit('package-extract', true);
|
||
|
resolve();
|
||
|
});
|
||
|
};
|