-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathgulpfile.js
More file actions
31 lines (26 loc) · 773 Bytes
/
gulpfile.js
File metadata and controls
31 lines (26 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var jshint = require('gulp-jshint')
var shell = require('gulp-shell')
var gulp = require('gulp')
var paths = {
solutions:'./exercises/*/solution/solution.js',
exercises:'./exercises/*/exercise.js',
scripts: './exercises/**/*.js'
}
gulp.task('lint', function() {
return gulp.src(paths.scripts)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
})
// WHY U NO FAIL ON ERRORS!?
gulp.task('verify-solutions', function() {
return gulp.src(paths.solutions, {read: false})
.pipe(
shell(
['node verify-solutions.js <%= file.path %>'],
{cwd: __dirname + '/tests'}))
.on('error', function (err) {
console.error(err)
process.exit(-1)
})
})
gulp.task('default', gulp.parallel('lint', 'verify-solutions'))