Skip to content

Commit 61ca488

Browse files
committed
Merge pull request #128 from addyosmani/msg
Tweak error messages.
2 parents 22bbb42 + 3657ae5 commit 61ca488

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tasks/uncss.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,24 @@ module.exports = function ( grunt ) {
2626
var src = f.src.filter(function ( filepath ) {
2727
// Warn on and remove invalid source files (if nonull was set).
2828
if ( !grunt.file.exists( filepath ) ) {
29-
grunt.log.warn( 'Source file "' + filepath + '" not found.' );
29+
grunt.log.warn( 'Source file ' + chalk.cyan( filepath ) + ' not found.' );
3030
return false;
3131
} else {
3232
return true;
3333
}
3434
});
3535

36+
if ( src.length === 0 ) {
37+
grunt.fail.warn( 'Destination (' + f.dest + ') not written because src files were empty.' );
38+
}
39+
3640
f.orig.src.forEach(function (source) {
3741
if (/^https?/.test(source)) {
3842
src.push(source);
3943
options.urls.push(source);
4044
}
4145
});
4246

43-
if ( src.length === 0 ) {
44-
grunt.log.warn( 'Destination (' + f.dest + ') not written because src files were empty.' );
45-
return;
46-
}
47-
4847
try {
4948
uncss( src, options, function ( error, output, report ) {
5049
if ( error ) {

0 commit comments

Comments
 (0)