mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #1202 from matiaspando/feature-adding-commit-hash
Added commit Hash to home page
This commit is contained in:
commit
297b5625bc
3
copay.js
3
copay.js
|
@ -16,7 +16,8 @@ var StorageLocalEncrypted = module.exports.StorageLocalEncrypted = require('./js
|
|||
module.exports.WalletFactory = require('./js/models/core/WalletFactory');
|
||||
module.exports.Wallet = require('./js/models/core/Wallet');
|
||||
module.exports.WalletLock = require('./js/models/core/WalletLock');
|
||||
module.exports.version = require('./version');
|
||||
module.exports.version = require('./version').version;
|
||||
module.exports.commitHash = require('./version').commitHash;
|
||||
|
||||
// test hack :s, will fix
|
||||
module.exports.FakePayProServer = require('./test/mocks/FakePayProServer');
|
||||
|
|
|
@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('VersionController',
|
|||
function($scope, $rootScope, $http, notification) {
|
||||
|
||||
$scope.version = copay.version;
|
||||
$scope.commitHash = copay.commitHash;
|
||||
$scope.networkName = config.networkName;
|
||||
|
||||
$http.get('https://api.github.com/repos/bitpay/copay/tags').success(function(data) {
|
||||
|
|
|
@ -69,7 +69,8 @@
|
|||
"socket.io-client": "1.0.6",
|
||||
"travis-cov": "0.2.5",
|
||||
"uglifyify": "1.2.3",
|
||||
"crypto-js": "3.1.2"
|
||||
"crypto-js": "3.1.2",
|
||||
"shelljs":"0.3.0"
|
||||
},
|
||||
"main": "app.js",
|
||||
"homepage": "https://github.com/bitpay/copay",
|
||||
|
|
|
@ -5,13 +5,25 @@
|
|||
var fs = require('fs');
|
||||
var browserify = require('browserify');
|
||||
var exec = require('child_process').exec;
|
||||
var shell = require('shelljs');
|
||||
|
||||
var puts = function(error, stdout, stderr) {
|
||||
if (error) console.log(error);
|
||||
};
|
||||
|
||||
var getCommitHash = function() {
|
||||
//exec git command to get the hash of the current commit
|
||||
//git rev-parse HEAD
|
||||
|
||||
var hash = shell.exec('git rev-parse HEAD',{silent:true}).output.trim().substr(0,7);
|
||||
return hash;
|
||||
}
|
||||
|
||||
var createVersion = function() {
|
||||
var json = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
||||
var content = 'module.exports="' + json.version + '";';
|
||||
var content = 'module.exports.version="' + json.version + '";';
|
||||
|
||||
content = content + '\nmodule.exports.commitHash="' + getCommitHash() + '";';
|
||||
fs.writeFileSync("./version.js", content);
|
||||
};
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<div ng-controller="VersionController">
|
||||
<small>v{{version}}</small>
|
||||
<small>#{{commitHash}}</small>
|
||||
<small ng-if="networkName=='testnet'">[ {{networkName}} ]</small>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue