Skip to content

Instantly share code, notes, and snippets.

@stefanbuck
Created February 6, 2014 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanbuck/8854706 to your computer and use it in GitHub Desktop.
Save stefanbuck/8854706 to your computer and use it in GitHub Desktop.
'use strict';
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var mocha = require('gulp-mocha');
var bump = require('gulp-bump');
var paths = {
lint: ['./gulpfile.js', './src/*.js'],
tests: './test/**/*.js',
};
gulp.task('lint', function () {
return gulp.src(paths.lint)
.pipe(jshint('.jshintrc'))
.pipe(jscs())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('mocha', function () {
gulp.src(paths.tests)
.pipe(mocha({ reporter: 'list' }));
});
gulp.task('bump', ['test'], function () {
var bumpType = process.env.BUMP || 'patch'; // major.minor.patch
return gulp.src(['./package.json'])
.pipe(bump({ type: bumpType }))
.pipe(gulp.dest('./'));
});
gulp.task('test', ['lint', 'mocha']);
gulp.task('release', ['bump']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment