added test runner for jenkins
This commit is contained in:
@ -9,23 +9,32 @@ var urlParamRE = /\{(\w+)\}/g;
|
||||
|
||||
var outputPath = _.joinPath(__dirname, '../../../src/lib/api.js');
|
||||
|
||||
require('./actions').on('ready', function (actions) {
|
||||
var defs = [];
|
||||
function download() {
|
||||
require('./actions').on('ready', function (actions) {
|
||||
var defs = [];
|
||||
|
||||
var namespaces = _.filter(_.map(actions, function (action) {
|
||||
if (~action.location.indexOf('.')) {
|
||||
var path = action.location.split('.').slice(0, -1);
|
||||
_.pull(path, 'prototype');
|
||||
return path.join('.');
|
||||
}
|
||||
}));
|
||||
|
||||
clean(outputPath);
|
||||
console.log('writing', actions.length, 'api actions to', outputPath);
|
||||
fs.writeFileSync(outputPath, templates.apiFile({
|
||||
actions: actions,
|
||||
namespaces: _.unique(namespaces.sort(), true)
|
||||
}));
|
||||
});
|
||||
var namespaces = _.filter(_.map(actions, function (action) {
|
||||
if (~action.location.indexOf('.')) {
|
||||
var path = action.location.split('.').slice(0, -1);
|
||||
_.pull(path, 'prototype');
|
||||
return path.join('.');
|
||||
}
|
||||
}));
|
||||
|
||||
clean(outputPath);
|
||||
console.log('writing', actions.length, 'api actions to', outputPath);
|
||||
fs.writeFileSync(outputPath, templates.apiFile({
|
||||
actions: actions,
|
||||
namespaces: _.unique(namespaces.sort(), true)
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
var stat = fs.statSync(outputPath);
|
||||
if (!stat.isFile() || stat.ctime < Date.now() - 86400000) {
|
||||
download();
|
||||
}
|
||||
} catch (e) {
|
||||
download();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user