remove tar.xz decompression and lzma deps

This commit is contained in:
blagoev 2017-12-20 14:52:31 +02:00
parent 34ea280492
commit 8ef6c67161
3 changed files with 5 additions and 8 deletions

View File

@ -1,5 +1,5 @@
PACKAGE_NAME=realm-js
VERSION=2.1.1
REALM_CORE_VERSION=4.0.2
REALM_SYNC_VERSION=2.1.10
REALM_SYNC_VERSION=2.2.1
REALM_OBJECT_SERVER_VERSION=2.0.21

View File

@ -80,7 +80,6 @@
"dependencies": {
"command-line-args": "^4.0.6",
"decompress": "^4.2.0",
"decompress-tarxz": "^2.1.1",
"fs-extra": "^4.0.2",
"ini": "^1.3.4",
"nan": "^2.3.3",
@ -91,8 +90,7 @@
"request": "^2.78.0",
"stream-counter": "^1.0.0",
"sync-request": "^3.0.1",
"url-parse": "^1.1.7",
"lzma-native": "^3.0.4"
"url-parse": "^1.1.7"
},
"devDependencies": {
"babel-eslint": "^6.0.4",

View File

@ -98,12 +98,11 @@ function download(serverFolder, archive, destination) {
function extract(downloadedArchive, targetFolder, archiveRootFolder) {
console.log(`Extracting ${path.basename(downloadedArchive)} => ${targetFolder}`);
const decompressOptions = /tar\.xz$/.test(downloadedArchive) ? { plugins: [ require('decompress-tarxz')() ] } : undefined;
if (!archiveRootFolder) {
return decompress(downloadedArchive, targetFolder, decompressOptions);
return decompress(downloadedArchive, targetFolder);
} else {
const tempExtractLocation = path.resolve(os.tmpdir(), path.basename(downloadedArchive, path.extname(downloadedArchive)));
return decompress(downloadedArchive, tempExtractLocation, decompressOptions)
return decompress(downloadedArchive, tempExtractLocation)
.then(() => fs.readdir(path.resolve(tempExtractLocation, archiveRootFolder)))
.then(items => Promise.all(items.map(item => {
const source = path.resolve(tempExtractLocation, archiveRootFolder, item);
@ -178,7 +177,7 @@ function getSyncRequirements(dependencies, options, required = {}) {
required.SYNC_ARCHIVE_ROOT = `realm-sync-node-cocoa-${dependencies.REALM_SYNC_VERSION}`;
return Promise.resolve(required);
case 'ios':
required.SYNC_ARCHIVE = `realm-sync-cocoa-${dependencies.REALM_SYNC_VERSION}.tar.xz`;
required.SYNC_ARCHIVE = `realm-sync-cocoa-${dependencies.REALM_SYNC_VERSION}.tar.gz`;
required.SYNC_ARCHIVE_ROOT = `core`;
return Promise.resolve(required);
case 'win': {