Skip to content

Commit

Permalink
Add silent option
Browse files Browse the repository at this point in the history
  • Loading branch information
STAH committed Jan 30, 2016
1 parent d24461b commit 5d7e18b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ Compile as AMD modules.
##### `cjs` _default_: `false`
Compile as CommonJS modules.

##### `silent` _default_: `false`
Suppress success compile messages.

### Example #1

```javascript
Expand Down Expand Up @@ -152,6 +155,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.

Release History
===============
* __30/01/2016 - 1.2.3__: Add silent option
* __30/01/2016 - 1.2.2__: Support 2.7.x options
* __07/02/2014 - 1.2.1__: Update jshint
* __14/01/2014 - 1.2.0__: Add append/prepend wrapper strings (@kreegr), error handling (@sunflowerdeath)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-dustjs",
"description": "Grunt task to compile Dust.js templates.",
"version": "1.2.2",
"version": "1.2.3",
"homepage": "https://github.com/STAH/grunt-dustjs",
"author": {
"name": "Stanislav Lesnikov",
Expand Down
9 changes: 6 additions & 3 deletions tasks/dustjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ module.exports = function (grunt) {
append : '',
whitespace: false,
amd: false,
cjs: false
cjs: false,
silent: false
});

this.files.forEach(function (file) {
Expand All @@ -42,8 +43,10 @@ module.exports = function (grunt) {
if (taskOutput.length > 0) {
var wrappedSourceCompiled = options.prepend + taskOutput.join("\n") + options.append;
grunt.file.write(file.dest, wrappedSourceCompiled);
grunt.verbose.writeln("[dustjs] Compiled " + grunt.log.wordlist(srcFiles.toString().split(","), {color: false}) + " => " + file.dest);
grunt.verbose.or.writeln("[dustjs] Compiled " + file.dest);
if (!options.silent) {
grunt.verbose.writeln("[dustjs] Compiled " + grunt.log.wordlist(srcFiles.toString().split(","), {color: false}) + " => " + file.dest);
grunt.verbose.or.writeln("[dustjs] Compiled " + file.dest);
}
}
});
});
Expand Down

0 comments on commit 5d7e18b

Please sign in to comment.