Skip to content

Commit

Permalink
Add parameter for ignoring errors
Browse files Browse the repository at this point in the history
Add a parameter to skip any errors and just
show the error. "skipErrors" continues
the process even on connection fail
  • Loading branch information
eparisio authored and fatso83 committed Nov 19, 2015
1 parent 6f52d18 commit 584c89c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ grunt.loadNpmTasks('grunt-penthouse');

### Configure the Grunt task

In your project's Gruntfile, add a section named `penthouse` to the data object passed into `grunt.initConfig()`.
In your project's Gruntfile, add a section named `penthouse` to the data object
passed into `grunt.initConfig()`.

#### Example

Expand All @@ -34,7 +35,8 @@ grunt.initConfig({
css : './dist/css/full.css',
url : 'http://localhost:9000',
width : 1300,
height : 900
height : 900,
skipErrors : false // this is the default
},
},
});
Expand All @@ -57,3 +59,4 @@ See its README for an example on how to achieve this.
- v0.1.1 First working release
- v0.1.2 Updated to penthouse version 0.2.5
- v0.2.1 Updated to penthouse version 0.3.0
- v0.3.0 Added `skipErrors` option. Range version for Penthouse.
9 changes: 7 additions & 2 deletions tasks/penthouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ module.exports = function (grunt) {
penthouse(options, function (err, result) {
if (err) {
if (err.msg) { grunt.log.errorlns(err.msg); }
done(false);
grunt.log.error(err);

if(options.skipErrors) { done(); }
else { done(false); }

return;
}

grunt.log.writeln("Done!");
grunt.log.debug(result);

grunt.file.write(options.outfile, result, {});
done();
});
});
};

0 comments on commit 584c89c

Please sign in to comment.