From dd2d98a9e094c6b0e9f66ed70819ef00e47a4ac5 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 31 Aug 2017 14:38:19 -0700 Subject: [PATCH] Fix downloading the prebuilt core for ios --- scripts/download-realm.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/download-realm.js b/scripts/download-realm.js index 30fc36a4..a5eecf4b 100644 --- a/scripts/download-realm.js +++ b/scripts/download-realm.js @@ -105,7 +105,7 @@ const optionDefinitions = [ const options = require('command-line-args')(optionDefinitions); console.log(options); -let serverFolder, archive, extractedFolder; +let serverFolder, archive, extractedFolder, forceXZ = false; const dependencies = ini(fs.readFileSync(path.resolve(__dirname, '../dependencies.list'), 'utf8')); if (!options.sync) { @@ -143,8 +143,9 @@ if (!options.sync) { extractedFolder = `realm-sync-node-cocoa-${dependencies.REALM_SYNC_VERSION}`; break; case 'ios': - archive = `realm-sync-cocoa-${dependencies.REALM_SYNC_VERSION}.tar.xz`; + archive = `realm-sync-cocoa-${dependencies.REALM_SYNC_VERSION}.tar.gz`; extractedFolder = `core`; + forceXZ = true; break; } } @@ -168,7 +169,7 @@ if (options.debug) { if (!fs.existsSync(realmDir)) { const targetFolder = extractedFolder ? vendorDir : realmDir; - const decompressOptions = /tar\.xz$/.test(archive) ? { plugins: [ decompressXZ() ] } : undefined; + const decompressOptions = forceXZ || /tar\.xz$/.test(archive) ? { plugins: [ decompressXZ() ] } : undefined; let pipeline = download(url, downloadedArchive); pipeline = pipeline.then(() => decompress(downloadedArchive, targetFolder, decompressOptions)); @@ -181,4 +182,4 @@ if (!fs.existsSync(realmDir)) { console.log('Downloading Realm binaries failed with', error); process.exit(-1); }); -} \ No newline at end of file +}