Travis now fails build if linting fails

This commit is contained in:
jacobawenger
2014-09-13 15:56:34 -07:00
parent d926873294
commit fcee54c729
2 changed files with 14 additions and 3 deletions

View File

@@ -12,6 +12,10 @@ var uglify = require("gulp-uglify");
// Testing
var karma = require("gulp-karma");
// Determine if this is being run in Travis
var travis = (process.argv.indexOf('--travis') > -1);
/****************/
/* FILE PATHS */
/****************/
@@ -47,6 +51,7 @@ var paths = {
}
};
/***********/
/* TASKS */
/***********/
@@ -66,6 +71,12 @@ gulp.task("scripts", function() {
// Lint
.pipe(jshint())
.pipe(jshint.reporter("jshint-stylish"))
.pipe(jshint.reporter("fail"))
.on("error", function(error) {
if (travis) {
throw error;
}
})
// Write un-minified version
.pipe(gulp.dest(paths.scripts.dest.dir))
@@ -89,8 +100,8 @@ gulp.task("test", function() {
configFile: paths.tests.config,
action: "run"
}))
.on("error", function(err) {
throw err;
.on("error", function(error) {
throw error;
});
});

View File

@@ -54,6 +54,6 @@
},
"scripts": {
"test": "gulp test",
"travis": "gulp"
"travis": "gulp --travis"
}
}