arnaucube
arnaucube/commonroutesAppPublic Self-hosted repository
commonroutesApp/gulpfile.js
gulpfile.jsRaw
 1var gulp = require('gulp');
 2var gutil = require('gulp-util');
 3var bower = require('bower');
 4var concat = require('gulp-concat');
 5var sass = require('gulp-sass');
 6var minifyCss = require('gulp-minify-css');
 7var rename = require('gulp-rename');
 8var sh = require('shelljs');
 9
10var paths = {
11  sass: ['./scss/**/*.scss']
12};
13
14gulp.task('default', ['sass']);
15
16gulp.task('sass', function(done) {
17  gulp.src('./scss/ionic.app.scss')
18    .pipe(sass())
19    .on('error', sass.logError)
20    .pipe(gulp.dest('./www/css/'))
21    .pipe(minifyCss({
22      keepSpecialComments: 0
23    }))
24    .pipe(rename({ extname: '.min.css' }))
25    .pipe(gulp.dest('./www/css/'))
26    .on('end', done);
27});
28
29gulp.task('watch', function() {
30  gulp.watch(paths.sass, ['sass']);
31});
32
33gulp.task('install', ['git-check'], function() {
34  return bower.commands.install()
35    .on('log', function(data) {
36      gutil.log('bower', gutil.colors.cyan(data.id), data.message);
37    });
38});
39
40gulp.task('git-check', function(done) {
41  if (!sh.which('git')) {
42    console.log(
43      '  ' + gutil.colors.red('Git is not installed.'),
44      '\n  Git, the version control system, is required to download Ionic.',
45      '\n  Download git here:', gutil.colors.cyan('http://git-scm.com/downloads') + '.',
46      '\n  Once git is installed, run \'' + gutil.colors.cyan('gulp install') + '\' again.'
47    );
48    process.exit(1);
49  }
50  done();
51});