From 6f058193ab6ab3bd355de5e0b38efe887365c795 Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Wed, 6 May 2020 22:52:00 +0500 Subject: [PATCH 1/2] NEW: `binaries_version` in `package.json` --- binaries.js | 8 +++----- install.js | 2 +- package.json | 3 ++- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/binaries.js b/binaries.js index dcf303a..aa879ea 100644 --- a/binaries.js +++ b/binaries.js @@ -14,14 +14,12 @@ * limitations under the License. */ -const fs = require('fs'); +const {version, binaries_version} = require('./package.json'); const path = require('path'); const os = require('os'); - -const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'))); const p = os.platform(); -const v = pkg.version.split('.'); -const bv = `${v[0]}.${v[1]}.${~~(Number.parseInt(v[2]) / 100) * 100}`.split('.').join('_'); +const v = version.split('.'); +const bv = (binaries_version || `${v[0]}.${v[1]}.${~~(Number.parseInt(v[2]) / 100) * 100}`).split('.').join('_'); const bp = path.resolve(os.homedir(), '.tonlabs', 'binaries', bv); module.exports = { p, bv, bp }; diff --git a/install.js b/install.js index bb62ed9..f08a487 100644 --- a/install.js +++ b/install.js @@ -86,7 +86,7 @@ function downloadAndGunzip(dest, url) { async function dl(dst, src) { const dst_path = `${root}/${dst}`; const src_url = `http://${binariesHost}/${src}.gz`; - process.stdout.write(`Downloading ${dst} from ${binariesHost} ...`); + process.stdout.write(`Downloading ${dst} from ${src_url} ...`); await downloadAndGunzip(dst_path, src_url); process.stdout.write('\n'); } diff --git a/package.json b/package.json index 36a404f..69cf563 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "ton-client-react-native-js", - "version": "0.22.0", + "version": "0.23.0", + "binaries_version": "0.23.1", "description": "TON Client Library for React Native", "main": "index.js", "scripts": { From 93393bba675bc8a9d572ad63aa6dcf02613125b1 Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Thu, 14 May 2020 20:28:32 +0500 Subject: [PATCH 2/2] NEW: use major core version to download binaries --- binaries.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/binaries.js b/binaries.js index aa879ea..49b68b9 100644 --- a/binaries.js +++ b/binaries.js @@ -19,7 +19,6 @@ const path = require('path'); const os = require('os'); const p = os.platform(); -const v = version.split('.'); -const bv = (binaries_version || `${v[0]}.${v[1]}.${~~(Number.parseInt(v[2]) / 100) * 100}`).split('.').join('_'); +const bv = (binaries_version || version).split('.')[0]; const bp = path.resolve(os.homedir(), '.tonlabs', 'binaries', bv); module.exports = { p, bv, bp };