{"size": 1764, "ext": "js", "max_stars_repo_path": "gulpfile.js", "max_stars_repo_name": "xiaohuidong99/ionic2", "max_stars_repo_stars_event_min_datetime": "2016-04-15T13:52:08.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-24T08:26:44.000Z", "max_issues_repo_path": "gulpfile.js", "max_issues_repo_name": "zwq8299174/ionic2", "max_issues_repo_issues_event_min_datetime": "2016-04-18T05:51:32.000Z", "max_issues_repo_issues_event_max_datetime": "2017-09-14T01:57:17.000Z", "max_forks_repo_path": "gulpfile.js", "max_forks_repo_name": "zwq8299174/ionic2", "max_forks_repo_forks_event_min_datetime": "2016-04-15T15:41:16.000Z", "max_forks_repo_forks_event_max_datetime": "2019-03-04T08:53:59.000Z"}
{"max_stars_count": 459, "max_issues_count": 6, "max_forks_count": 149, "avg_line_length": 33.9230769231, "max_line_length": 83, "alphanum_fraction": 0.6587301587}
var gulp = require('gulp');
var del = require('del');
var exec = require('child_process').exec;
var config = require('./scripts/config.json');
var gulpWatch = require('gulp-watch');
var argv = process.argv;

/**
 * Ionic Gulp tasks, for more information on each see
 * https://github.com/driftyco/ionic-gulp-tasks
 */
var buildBrowserify = require('ionic-gulp-browserify-typescript');
var buildSass = require('ionic-gulp-sass-build');
var copyHTML = require('ionic-gulp-html-copy');
var copyFonts = require('ionic-gulp-fonts-copy');
var copyScripts = require('ionic-gulp-scripts-copy');

gulp.task('watch', ['sass', 'html', 'fonts'], function(done) {
  gulpWatch('app/**/*.scss', function() { gulp.start('sass'); });
  gulpWatch('app/**/*.html', function() { gulp.start('html'); });
  buildBrowserify({ watch: true }).on('end', done);
});
gulp.task('build', ['sass', 'html', 'fonts'], buildBrowserify);
gulp.task('sass', buildSass);
gulp.task('html', copyHTML);
gulp.task('fonts', copyFonts);
gulp.task('scripts', copyScripts);
gulp.task('clean', function(done) {
  del('www/build', done);
});

/**
 * Ionic hooks
 * Add ':before' or ':after' to any Ionic project command name to run the specified
 * tasks before or after the command.
 */
gulp.task('serve:before', ['watch']);
gulp.task('emulate:before', ['build']);
gulp.task('deploy:before', ['build']);

// we want to 'watch' when livereloading
var shouldWatch = argv.indexOf('-l') > -1 || argv.indexOf('--livereload') > -1;
gulp.task('run:before', [shouldWatch ? 'watch' : 'build']);

/* FOR IONIC SITE DEBUGGING ONLY */
gulp.task('site-watch', ['site-copy'], function() {
  gulp.watch('app/**/*', ['site-copy']);
});
gulp.task('site-copy', ['build'], function() {
  exec('cp -R www ' + config.demoDest);
});
