mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2025-03-11 20:34:40 +03:00
rewrite
This commit is contained in:
parent
736c554c69
commit
0d4bcfd6f6
7 changed files with 503 additions and 513 deletions
14
components/package.js
Normal file
14
components/package.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
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();
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue