Created
January 31, 2014 16:39
Revisions
-
bittersweetryan created this gist
Jan 31, 2014 .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,22 @@ var files = []; function walkDirs( start ){ //since this is happening async how can I tell when it's done to process the files fs.readdirSync( start, function( error, data ){ if( error ){ console.error( 'Oops!', error ); } else{ data.forEach( function( dirItem ){ if( fs.lstatSync( start + '/' + dirItem ).isDirectory() ){ return walkDirs( start + '/' + dirItem ); } else{ allFiles.push( dirItem ); } }); } } ); }