whitespace and block cleanup
This commit is contained in:
		
							parent
							
								
									5ea101960e
								
							
						
					
					
						commit
						042cc6d3d6
					
				| @ -10,5 +10,5 @@ | |||||||
|                     }, |                     }, | ||||||
|   "lib"           : ".", |   "lib"           : ".", | ||||||
|   "main"          : "./walk.js", |   "main"          : "./walk.js", | ||||||
|   "version"       : "2.1.0" |   "version"       : "2.1.1" | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										25
									
								
								lib/walk.js
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								lib/walk.js
									
									
									
									
									
								
							| @ -22,16 +22,17 @@ | |||||||
|       ; |       ; | ||||||
| 
 | 
 | ||||||
|     function readdirHandler(err, files) { |     function readdirHandler(err, files) { | ||||||
|       var fnodeGroups = TypeEmitter.createNodeGroups(); |       var fnodeGroups = TypeEmitter.createNodeGroups() | ||||||
|  |         ; | ||||||
| 
 | 
 | ||||||
|       function filesHandler(cont, file) { |       function filesHandler(cont, file) { | ||||||
|         var statPath; |         var statPath | ||||||
| 
 |           ; | ||||||
|         emitter.emit('name', curpath, file, noop); |  | ||||||
| 
 | 
 | ||||||
|         function lstatHandler(err, stat) { |         function lstatHandler(err, stat) { | ||||||
|           stat = stat || {}; |           stat = stat || {}; | ||||||
|           stat.name = file; |           stat.name = file; | ||||||
|  | 
 | ||||||
|           if (err) { |           if (err) { | ||||||
|             stat.error = err; |             stat.error = err; | ||||||
|             //emitter.emit('error', curpath, stat);
 |             //emitter.emit('error', curpath, stat);
 | ||||||
| @ -44,7 +45,10 @@ | |||||||
|           } |           } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         emitter.emit('name', curpath, file, noop); | ||||||
|  | 
 | ||||||
|         statPath = curpath + '/' + file; |         statPath = curpath + '/' + file; | ||||||
|  | 
 | ||||||
|         if (sync) { |         if (sync) { | ||||||
|           try { |           try { | ||||||
|             lstatHandler(null, fs.lstatSync(statPath)); |             lstatHandler(null, fs.lstatSync(statPath)); | ||||||
| @ -90,7 +94,11 @@ | |||||||
|         } |         } | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       if (err) { |       if (!err) { | ||||||
|  |         readFiles(); | ||||||
|  |         return; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|       if (!firstRun) { |       if (!firstRun) { | ||||||
|         emitter.emit('directoryError', curpath, { error: err }, noop); |         emitter.emit('directoryError', curpath, { error: err }, noop); | ||||||
|         readFiles(); |         readFiles(); | ||||||
| @ -99,17 +107,14 @@ | |||||||
| 
 | 
 | ||||||
|       firstRun = false; |       firstRun = false; | ||||||
|       fs.lstat(curpath, function (e, stat) { |       fs.lstat(curpath, function (e, stat) { | ||||||
|  | 
 | ||||||
|         if (stat) { |         if (stat) { | ||||||
|           files = [curpath.replace(/.*\//, '')]; |           files = [curpath.replace(/.*\//, '')]; | ||||||
|           curpath = curpath.replace(files[0], ''); |           curpath = curpath.replace(files[0], ''); | ||||||
|         } |         } | ||||||
|           readFiles(); |  | ||||||
|         }) |  | ||||||
|         //emitter.emit('error', curpath, { error: err });
 |  | ||||||
|         return; |  | ||||||
|       } |  | ||||||
| 
 | 
 | ||||||
|         readFiles(); |         readFiles(); | ||||||
|  |       }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     function walkSync() { |     function walkSync() { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user