forked from nani92/Tux4Words
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
47 lines (44 loc) · 1.26 KB
/
Copy pathgulpfile.js
File metadata and controls
47 lines (44 loc) · 1.26 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// generated on 2015-01-12 using generator-m 0.2.7
/* jshint -W079 */ // prevent redefinition of $ warning
'use strict';
var gulp = require('gulp');
// config
gulp.paths = {
dist: 'www',
jsFiles: ['app/**/*.js', '!app/bower_components/**/*.js'],
jsonFiles: ['app/**/*.json', '!app/bower_components/**/*.json'],
icoaticCss: 'app/main/assets/fonts/icons-master/font/icomatic.css'
};
// retrieve options
var minimist = require('minimist');
var options = gulp.options = minimist(process.argv.slice(2));
// gulp build before running cordova?
if (options.cordova && options.build !== false) { // --no-build
var cmds = ['build', 'run', 'emulate', 'prepare'];
for (var i = 0, cmd; (cmd = cmds[i]); i++) {
if (options.cordova.indexOf(cmd) >= 0) {
options.runBuild = true;
break;
}
}
}
// environment
options.env = options.env || 'dev';
// load tasks
var requireDir = require('require-dir');
requireDir('./gulp_tasks');
// MAIN TASKS
gulp.task('default', function () {
// cordova with build
if (options.runBuild) {
return gulp.start('cordova-with-build');
}
// cordova without build
else if (options.cordova) {
return gulp.start('cordova');
}
// just watch when cordova option not present
else {
return gulp.start('watch');
}
});