-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
32 lines (28 loc) · 816 Bytes
/
gulpfile.js
File metadata and controls
32 lines (28 loc) · 816 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
32
var exec = require('child_process').exec;
var gulp = require('gulp');
var runSequence = require('run-sequence');
var bootlint = require('gulp-bootlint');
// Validate html, links, etc.
gulp.task('html-proofer', function(done) {
execute('htmlproofer ./index.min.html --check-html --check-favicon --check-external-hash', {}, done);
});
// Validate bootstrap
gulp.task('bootlint', function() {
return gulp.src('./index.html.min')
.pipe(bootlint({
stoponerror: true
}));
});
// Full test task
gulp.task('test', function(cb) {
runSequence('html-proofer', 'bootlint', cb);
});
// Util to execute external command
function execute(cmd, opts, done) {
console.log(cmd);
exec(cmd, opts, function(error, stdout, stderr) {
console.log(stdout);
console.error(stderr);
done(error);
});
}