提交 7cc0c602 编写于 作者: M Martin Aeschlimann

validate BUILD_SOURCEVERSION

上级 34143ca0
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册