validate BUILD_SOURCEVERSION
parent
c5d0d0d786
commit
ff6c7a2306
|
@ -14,7 +14,7 @@ var util = require('./lib/util');
|
|||
var common = require('./gulpfile.common');
|
||||
|
||||
var root = path.dirname(__dirname);
|
||||
var commit = process.env['BUILD_SOURCEVERSION'] || require('./lib/git').getVersion(root);
|
||||
var commit = util.getVersion(root);
|
||||
|
||||
// Build
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ var util = require('./lib/util');
|
|||
var buildfile = require('../src/buildfile');
|
||||
var common = require('./gulpfile.common');
|
||||
var root = path.dirname(__dirname);
|
||||
var commit = process.env['BUILD_SOURCEVERSION'] || require('./lib/git').getVersion(root);
|
||||
var commit = util.getVersion(root);
|
||||
|
||||
var baseModules = [
|
||||
'app', 'applicationinsights', 'assert', 'auto-updater', 'browser-window',
|
||||
|
|
|
@ -10,6 +10,7 @@ var _ = require('underscore');
|
|||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var rimraf = require('rimraf');
|
||||
var git = require('./git');
|
||||
|
||||
var NoCancellationToken = {
|
||||
isCancellationRequested: function () {
|
||||
|
@ -275,4 +276,14 @@ exports.downloadExtensions = function(extensions) {
|
|||
});
|
||||
|
||||
return es.merge(streams);
|
||||
};
|
||||
|
||||
exports.getVersion = function (root) {
|
||||
var version = process.env['BUILD_SOURCEVERSION'];
|
||||
|
||||
if (!version || !/^[0-9a-f]{40}$/i.test(version)) {
|
||||
version = git.getVersion(root);
|
||||
}
|
||||
|
||||
return version;
|
||||
};
|
Loading…
Reference in New Issue