Use gz
This commit is contained in:
parent
3f306a4938
commit
4b31874a56
|
@ -6,7 +6,7 @@
|
|||
|
||||
In **package.json** use the `"postinstall"` script to download the libraries.
|
||||
For example the following structure might work. Note that **Addon Tools** will
|
||||
append any given URL with `/${getPlatform()}.gzip`
|
||||
append any given URL with `/${getPlatform()}.gz`
|
||||
|
||||
In **package.json**:
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ const { getPlatform, getBin } = require('../include');
|
|||
|
||||
const actionPack = async () => {
|
||||
try {
|
||||
await exec(`cd ${getBin()} && tar -acf ../${getPlatform()}.gzip *`);
|
||||
console.log(`pack=${getPlatform()}.gzip`);
|
||||
await exec(`cd ${getBin()} && tar -czf ../${getPlatform()}.gz *`);
|
||||
console.log(`pack=${getPlatform()}.gz`);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
process.exit(-1);
|
||||
|
|
|
@ -47,7 +47,7 @@ const installRecursive = async (url, count = 1) => {
|
|||
await rmdir(getBin());
|
||||
await mkdir(getBin());
|
||||
|
||||
const packPath = `${getBin()}/${getPlatform()}.gzip`;
|
||||
const packPath = `${getBin()}/${getPlatform()}.gz`;
|
||||
|
||||
await new Promise((res, rej) => {
|
||||
const packWriter = fs.createWriteStream(packPath);
|
||||
|
@ -66,7 +66,7 @@ const installRecursive = async (url, count = 1) => {
|
|||
|
||||
|
||||
const install = (folder) => {
|
||||
const url = `${folder}/${getPlatform()}.gzip`;
|
||||
const url = `${folder}/${getPlatform()}.gz`;
|
||||
installRecursive(url).then();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue