fixed an issue preventing the API generator from running, and batched the git-fetch calls for each es branch

This commit is contained in:
Spencer Alger
2014-04-30 09:34:28 -07:00
parent 17e95f836f
commit a82f8e14d3
4 changed files with 8 additions and 8 deletions

View File

@ -44,6 +44,6 @@ function _spawn(cmd, args, opts, cb) {
return cp;
}
_spawn.exec = function (cmd, cb) {
return _spawn('/bin/sh', ['-c', cmd], cb);
_spawn.exec = function (cmd, opts, cb) {
return _spawn('/bin/sh', ['-c', cmd], opts, cb);
};

View File

@ -89,8 +89,8 @@ function cloneStep() {
};
}
function fetchBranchStep(branch) {
return spawnStep('git', ['fetch', '--depth', '1', 'origin', branch], sourceDir);
function fetchBranchesStep() {
return spawnStep('git', ['fetch', '--depth', '1', 'origin'].concat(branches), sourceDir);
}
function removePrevArchive(branch) {
@ -123,12 +123,12 @@ function generateStep(branch) {
}
var steps = [
cloneStep()
cloneStep(),
fetchBranchesStep()
];
branches.forEach(function (branch) {
if (argv.update) steps.push(removePrevArchive(branch));
steps.push(
fetchBranchStep(branch),
createArchive(branch),
generateStep(branch)
);

View File

@ -18,7 +18,7 @@ module.exports = function (branch, done) {
var docVars; // slightly modified clone of apiSpec for the docs
var branchSuffix = utils.branchSuffix(branch);
var esDir = fromRoot('src/elasticsearch_' + _.snakeCase(branch));
var esDir = fromRoot('src/_elasticsearch_' + _.snakeCase(branch));
var aliases;
try {
aliases = require('./aliases_' + _.snakeCase(branch));

View File

@ -11,7 +11,7 @@ module.exports = function (branch, done) {
var _ = require(fromRoot('src/lib/utils'));
var tests = {}; // populated in readYamlTests
var esDir = fromRoot('src/elasticsearch_' + _.snakeCase(branch));
var esDir = fromRoot('src/_elasticsearch_' + _.snakeCase(branch));
// generate the yaml tests
async.series([