Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

Commit

Permalink
bug - options can now be passed in. fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallen23 committed Nov 12, 2013
1 parent 1ff3a33 commit 70ac413
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ module.exports = function(grunt) {

// Configuration to be run (and then tested).
inlinecss: {
default_options: {
basic: {
options: {
extraCss: 'body { background: green; }'
},
files: {
'examples/out.html': 'examples/in.html',
'tmp/out.html': 'test/fixtures/in.html'
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions tasks/inline_css.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = function(grunt) {

grunt.registerMultiTask('inlinecss', 'Takes an html file with css link and turns inline. Great for emails.', function() {
// Merge task-specific and/or target-specific options with these defaults.
var options = this.data.options;
var options = this.options();
var done = this.async();
var index = 0;
var count = this.files.length;
Expand All @@ -26,7 +26,7 @@ module.exports = function(grunt) {
this.files.forEach(function(f) {

var filepath = f.src.toString();
if (typeof filepath !== 'string') {
if (typeof filepath !== 'string' || filepath === '') {
grunt.log.error('src must be a single string');
return false;
}
Expand Down

0 comments on commit 70ac413

Please sign in to comment.