From 649500a22f5481dbb69897fd789c9ade818609e1 Mon Sep 17 00:00:00 2001 From: oleg Date: Fri, 21 Aug 2015 23:38:20 +0300 Subject: [PATCH] support project steps object --- data/projects/nci/config.yaml | 4 ++-- lib/project.js | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/data/projects/nci/config.yaml b/data/projects/nci/config.yaml index 9c3be6b..d1b1acc 100644 --- a/data/projects/nci/config.yaml +++ b/data/projects/nci/config.yaml @@ -14,5 +14,5 @@ notify: console: steps: - - cmd: npm install && npm prune - - cmd: npm test + sync: npm install && npm prune + test: npm test diff --git a/lib/project.js b/lib/project.js index eaa7839..c478450 100644 --- a/lib/project.js +++ b/lib/project.js @@ -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';