mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-10 18:09:15 +00:00
support project steps object
This commit is contained in:
parent
93c7ea0d4e
commit
649500a22f
@ -14,5 +14,5 @@ notify:
|
||||
console:
|
||||
|
||||
steps:
|
||||
- cmd: npm install && npm prune
|
||||
- cmd: npm test
|
||||
sync: npm install && npm prune
|
||||
test: npm test
|
||||
|
@ -64,6 +64,20 @@ exports.loadConfig = function(dir, callback) {
|
||||
reader.load(dir, 'config', this.slot());
|
||||
},
|
||||
function(err, config) {
|
||||
// convert steps object to array
|
||||
if (!_(config.steps).isArray() && _(config.steps).isObject()) {
|
||||
config.steps = _(config.steps).map(function(val, name) {
|
||||
var step;
|
||||
if (_(val).isObject()) {
|
||||
step = val;
|
||||
} else {
|
||||
step = {cmd: val};
|
||||
}
|
||||
step.name = name;
|
||||
return step;
|
||||
});
|
||||
}
|
||||
|
||||
// apply defaults
|
||||
_(config.steps).each(function(step) {
|
||||
if (!step.type) step.type = 'shell';
|
||||
|
Loading…
Reference in New Issue
Block a user