Permalink
Browse files

Fix #78, grunticon shouldn't run if there are no files in the source …

…directory
  • Loading branch information...
1 parent 5633e56 commit 072e44d04b9791a7a595e18e5656d7f0748b7969 @jefflembeck jefflembeck committed Aug 13, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 tasks/grunticon.js
View
@@ -115,6 +115,11 @@ module.exports = function( grunt , undefined ) {
config.dest += path.sep;
}
+ var f = fs.readdirSync( config.src );
+ if( f.length === 0 ){
+ grunt.log.writeln( "Grunticon has no files to read!" );
+ done();
+ }
var asyncCSS = config.files.loader;
var asyncCSSBanner = config.files.banner;
@@ -283,6 +288,7 @@ module.exports = function( grunt , undefined ) {
if( grunt.file.exists( path.join( config.dest , pngfolder ) ) ){
grunt.file.delete( path.join( config.dest, pngfolder ) );
}
+
crusher.crush({
input: tmpPngfolder,
outputDir: path.join( config.dest , pngfolder ),

0 comments on commit 072e44d

Please sign in to comment.