From dea951fc429fc2855d7be5c194d4921503e7228e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 9 May 2016 18:21:52 +0200 Subject: [PATCH 1/2] About WebTorrent: Show `webtorrent` library version Closes #475 --- bin/package.js | 10 ++++++---- renderer/about.html | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/package.js b/bin/package.js index 298fc84b..1d167da1 100755 --- a/bin/package.js +++ b/bin/package.js @@ -18,6 +18,7 @@ var config = require('../config') var pkg = require('../package.json') var BUILD_NAME = config.APP_NAME + '-v' + config.APP_VERSION +var GIT_HASH = cp.execSync('git rev-parse --short HEAD').toString().replace('\n', '') /* * Path to folder with the following files: @@ -85,9 +86,10 @@ var all = { 'asar-unpack': 'WebTorrent*', // The build version of the application. Maps to the FileVersion metadata property on - // Windows, and CFBundleVersion on OS X. We're using the short git hash (e.g. 'e7d837e') - // Windows requires the build version to start with a number :/ so we stick on a prefix - 'build-version': '0-' + cp.execSync('git rev-parse --short HEAD').toString().replace('\n', ''), + // Windows, and CFBundleVersion on OS X. We're using the version of the underlying + // WebTorrent library, plus a short git hash (e.g. 'e7d837e'). Note: Windows requires + // the build version to start with a number. + 'build-version': require('webtorrent/package.json').version + '-' + GIT_HASH, // The application source directory. dir: config.ROOT_PATH, @@ -110,7 +112,7 @@ var all = { prune: true, // The Electron version with which the app is built (without the leading 'v') - version: pkg.dependencies['electron-prebuilt'] + version: require('electron-prebuilt/package.json').version } var darwin = { diff --git a/renderer/about.html b/renderer/about.html index e03e9590..37a77b59 100644 --- a/renderer/about.html +++ b/renderer/about.html @@ -29,7 +29,10 @@

WebTorrent

-

Version

+

+ Version + () +

From 15a59f445b87b9de0e3a8844d35b3ae0aa0f1c8f Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 9 May 2016 18:29:22 +0200 Subject: [PATCH 2/2] About WebTorrent: Remove git hash from build version --- bin/package.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/package.js b/bin/package.js index 1d167da1..33885784 100755 --- a/bin/package.js +++ b/bin/package.js @@ -18,7 +18,6 @@ var config = require('../config') var pkg = require('../package.json') var BUILD_NAME = config.APP_NAME + '-v' + config.APP_VERSION -var GIT_HASH = cp.execSync('git rev-parse --short HEAD').toString().replace('\n', '') /* * Path to folder with the following files: @@ -86,10 +85,9 @@ var all = { 'asar-unpack': 'WebTorrent*', // The build version of the application. Maps to the FileVersion metadata property on - // Windows, and CFBundleVersion on OS X. We're using the version of the underlying - // WebTorrent library, plus a short git hash (e.g. 'e7d837e'). Note: Windows requires - // the build version to start with a number. - 'build-version': require('webtorrent/package.json').version + '-' + GIT_HASH, + // Windows, and CFBundleVersion on OS X. Note: Windows requires the build version to + // start with a number. We're using the version of the underlying WebTorrent library. + 'build-version': require('webtorrent/package.json').version, // The application source directory. dir: config.ROOT_PATH,