-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (28 loc) · 1.05 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
var gutil = require('gulp-util');
var defaultWorkflow = {
js: ['build', 'bump', 'quality-assurance', 'server'],
angular: ['build', 'conf'],
nodejs: ['server'],
css: ['sass']
};
module.exports = function(gulp, config){
gulp = require('gulp-help')(gulp);
(function (config) {
var workflow = config.workflow || defaultWorkflow;
for(var module in workflow) {
if (!workflow.hasOwnProperty(module) || !Array.isArray(workflow[module])) {
gutil.log(gutil.colors.red('ERROR gulp-workflow :'), 'config.workflow.' + module, 'is not Array.');
continue;
}
workflow[module].forEach(function (subModule) {
try {
require('./tasks/' + module + '/' + subModule)(gulp, config);
} catch (e) {
gutil.log(gutil.colors.red('ERROR gulp-workflow not loaded module :'), module + ':' + subModule, '.');
console.error(e);
}
});
}
})(config);
};