Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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