Created
October 21, 2015 20:40
-
-
Save techieBrandon/f082e9a1c7dc20b83884 to your computer and use it in GitHub Desktop.
Revisions
-
techieBrandon created this gist
Oct 21, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ grunt.registerTask('scripts:exist',function(){ var filesList = grunt.template.process('<%= build.dist.js.dest %>').split(','); // console.log(filesList); var done = this.async(); var interval; var validate = function(){ var missedFiles = []; var validatedFile = []; filesList.forEach(function(file){ var exists = grunt.file.exists(file); // console.log(file+" exist: "+exists); if(!exists){ missedFiles.push(file); }else{ validatedFile.push(file); } }); validatedFile.forEach(function(file){ grunt.verbose.ok(file+' generation validated.'); }); missedFiles.forEach(function(file){ grunt.log.error(file+' not generated!'); }); if(missedFiles.length<1){ clearInterval(interval); done(); } }; setInterval(validate,50) })