only generate the necessary branch in CI environments
This commit is contained in:
@ -19,6 +19,10 @@ var argv = require('optimist')
|
||||
update: {
|
||||
default: true,
|
||||
boolean: true
|
||||
},
|
||||
branch: {
|
||||
default: null,
|
||||
string: true
|
||||
}
|
||||
});
|
||||
|
||||
@ -29,12 +33,6 @@ var utils = require(fromRoot('grunt/utils'));
|
||||
var esUrl = 'https://github.com/elasticsearch/elasticsearch.git';
|
||||
var branches;
|
||||
|
||||
if (process.env.ES_GIT_BRANCH) {
|
||||
branches = [process.env.ES_GIT_BRANCH.split('/').slice(1).join('/')];
|
||||
} else {
|
||||
branches = utils.branches;
|
||||
}
|
||||
|
||||
if (process.env.npm_config_argv) {
|
||||
// when called by NPM
|
||||
argv = argv.parse(JSON.parse(process.env.npm_config_argv).original);
|
||||
@ -43,6 +41,13 @@ if (process.env.npm_config_argv) {
|
||||
argv = argv.argv;
|
||||
}
|
||||
|
||||
if (argv.branch) {
|
||||
branches = [argv.branch];
|
||||
} else {
|
||||
branches = utils.branches;
|
||||
}
|
||||
|
||||
|
||||
function isDirectory(dir) {
|
||||
var stat;
|
||||
try { stat = fs.statSync(dir); } catch (e) {}
|
||||
|
||||
Reference in New Issue
Block a user