Skip to content

Commit

Permalink
Merge pull request #128 from addyosmani/msg
Browse files Browse the repository at this point in the history
Tweak error messages.
  • Loading branch information
addyosmani committed Oct 3, 2014
2 parents 22bbb42 + 3657ae5 commit 61ca488
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tasks/uncss.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,24 @@ module.exports = function ( grunt ) {
var src = f.src.filter(function ( filepath ) {
// Warn on and remove invalid source files (if nonull was set).
if ( !grunt.file.exists( filepath ) ) {
grunt.log.warn( 'Source file "' + filepath + '" not found.' );
grunt.log.warn( 'Source file ' + chalk.cyan( filepath ) + ' not found.' );
return false;
} else {
return true;
}
});

if ( src.length === 0 ) {
grunt.fail.warn( 'Destination (' + f.dest + ') not written because src files were empty.' );
}

f.orig.src.forEach(function (source) {
if (/^https?/.test(source)) {
src.push(source);
options.urls.push(source);
}
});

if ( src.length === 0 ) {
grunt.log.warn( 'Destination (' + f.dest + ') not written because src files were empty.' );
return;
}

try {
uncss( src, options, function ( error, output, report ) {
if ( error ) {
Expand Down

0 comments on commit 61ca488

Please sign in to comment.