Change grunt watch task for first run a build

This commit is contained in:
Eric Ferraiuolo 2013-06-07 13:00:35 -04:00
parent c25c08097b
commit 04d158f414

View File

@ -229,12 +229,12 @@ grunt.initConfig({
}
},
// -- Watch Config ---------------------------------------------------------
// -- Watch/Observe Config -------------------------------------------------
watch: {
observe: {
src: {
files: 'src/**/css/*.css',
tasks: ['test', 'default'],
tasks: ['test', 'suppress', 'default'],
options: {
interrupt: true
@ -263,15 +263,19 @@ grunt.registerTask('default', [
'license'
]);
grunt.registerTask('test', [
'csslint'
]);
// Makes the `watch` task run a build first.
grunt.renameTask('watch', 'observe');
grunt.registerTask('watch', ['default', 'observe']);
grunt.registerTask('import', [
'bower-install',
'import-normalize'
]);
grunt.registerTask('test', [
'csslint'
]);
grunt.registerTask('release', [
'test',
'default',
@ -279,6 +283,26 @@ grunt.registerTask('release', [
'compress:release'
]);
// -- Suppress Task ------------------------------------------------------------
grunt.registerTask('suppress', function () {
var allowed = ['success', 'fail', 'warn', 'error'];
grunt.util.hooker.hook(grunt.log, {
passName: true,
pre: function (name) {
if (allowed.indexOf(name) === -1) {
grunt.log.muted = true;
}
},
post: function () {
grunt.log.muted = false;
}
});
});
// -- Import Tasks -------------------------------------------------------------
grunt.registerTask('import-normalize', [