forked from pure-css/pure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move local Grunt tasks to tasks/ dir
- Loading branch information
Showing
4 changed files
with
65 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
module.exports = function (grunt) { | ||
grunt.registerTask('bower_install', 'Installs Bower dependencies.', function () { | ||
var bower = require('bower'), | ||
done = this.async(); | ||
|
||
bower.commands.install() | ||
.on('log', function (data) { | ||
if (data.id !== 'install') { return; } | ||
grunt.log.writeln('bower ' + data.id.cyan + ' ' + data.message); | ||
}) | ||
.on('end', function (results) { | ||
if (!Object.keys(results).length) { | ||
grunt.log.writeln('No bower packages to install.'); | ||
} | ||
|
||
done(); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
module.exports = function (grunt) { | ||
grunt.registerMultiTask('license', 'Stamps license banners on files.', function () { | ||
var options = this.options({banner: ''}), | ||
banner = grunt.template.process(options.banner), | ||
tally = 0; | ||
|
||
this.files.forEach(function (filePair) { | ||
filePair.src.forEach(function (file) { | ||
grunt.file.write(file, banner + grunt.file.read(file)); | ||
tally += 1; | ||
}); | ||
}); | ||
|
||
grunt.log.writeln('Stamped license on ' + String(tally).cyan + ' files.'); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
module.exports = function (grunt) { | ||
grunt.registerTask('suppress', 'Suppresses noisy logs', 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; | ||
} | ||
}); | ||
}); | ||
}; |