diff options
author | Martin Aeschlimann <martinae@microsoft.com> | 2015-11-24 21:12:56 +0300 |
---|---|---|
committer | Martin Aeschlimann <martinae@microsoft.com> | 2015-11-24 21:12:56 +0300 |
commit | 7cc0c602a2b802b09a3f56b68a1a61ee9e8f0066 (patch) | |
tree | 121e3b961f859c5434c8a9171871740079b9d431 | |
parent | 34143ca09ea18c2d3dfdd0c140774639fa5edb69 (diff) |
validate BUILD_SOURCEVERSION0.10.2
-rw-r--r-- | build/lib/util.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/build/lib/util.js b/build/lib/util.js index 5bb82a71055..7424e8e6876 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -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; };
\ No newline at end of file |