About WebTorrent: Show webtorrent library version

Closes #475
This commit is contained in:
Feross Aboukhadijeh
2016-05-09 18:21:52 +02:00
parent 347eb2c7f0
commit dea951fc42
2 changed files with 10 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ var config = require('../config')
var pkg = require('../package.json') var pkg = require('../package.json')
var BUILD_NAME = config.APP_NAME + '-v' + config.APP_VERSION 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: * Path to folder with the following files:
@@ -85,9 +86,10 @@ var all = {
'asar-unpack': 'WebTorrent*', 'asar-unpack': 'WebTorrent*',
// The build version of the application. Maps to the FileVersion metadata property on // 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, and CFBundleVersion on OS X. We're using the version of the underlying
// Windows requires the build version to start with a number :/ so we stick on a prefix // WebTorrent library, plus a short git hash (e.g. 'e7d837e'). Note: Windows requires
'build-version': '0-' + cp.execSync('git rev-parse --short HEAD').toString().replace('\n', ''), // the build version to start with a number.
'build-version': require('webtorrent/package.json').version + '-' + GIT_HASH,
// The application source directory. // The application source directory.
dir: config.ROOT_PATH, dir: config.ROOT_PATH,
@@ -110,7 +112,7 @@ var all = {
prune: true, prune: true,
// The Electron version with which the app is built (without the leading 'v') // 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 = { var darwin = {

View File

@@ -29,7 +29,10 @@
<body> <body>
<img src="../static/WebTorrent.png"> <img src="../static/WebTorrent.png">
<h1>WebTorrent</h1> <h1>WebTorrent</h1>
<p>Version <script>document.write(require('../package.json').version)</script></p> <p>
Version <script>document.write(require('../package.json').version)</script>
(<script>document.write(require('webtorrent/package.json').version)</script>)
</p>
<p><script>document.write(require('../config').APP_COPYRIGHT)</script></p> <p><script>document.write(require('../config').APP_COPYRIGHT)</script></p>
</body> </body>
</html> </html>