Reduce shell calls to single steps
[cacert-boardvoting.git] / semantic / tasks / build.js
1 /*******************************
2 Build Task
3 *******************************/
4
5 var
6 // dependencies
7 gulp = require('gulp-help')(require('gulp')),
8 runSequence = require('run-sequence'),
9
10 // config
11 config = require('./config/user'),
12 install = require('./config/project/install'),
13
14 // task sequence
15 tasks = []
16 ;
17
18
19 // sub-tasks
20 if(config.rtl) {
21 require('./collections/rtl')(gulp);
22 }
23 require('./collections/build')(gulp);
24
25
26 module.exports = function(callback) {
27
28 console.info('Building Semantic');
29
30 if( !install.isSetup() ) {
31 console.error('Cannot find semantic.json. Run "gulp install" to set-up Semantic');
32 return 1;
33 }
34
35 // check for right-to-left (RTL) language
36 if(config.rtl === true || config.rtl === 'Yes') {
37 gulp.start('build-rtl');
38 return;
39 }
40
41 if(config.rtl == 'both') {
42 tasks.push('build-rtl');
43 }
44
45 tasks.push('build-javascript');
46 tasks.push('build-css');
47 tasks.push('build-assets');
48
49 runSequence(tasks, callback);
50 };