 	exports.rebuildPackageCache() unless packageCache?
 	
 	results = {}
-	
-	invokeRecursive = (path, parent) ->
-		
-		for key, objectOrFunction of parent
-			
-			if key.charCodeAt(0) is '$'.charCodeAt(0)
-	
-				if key is "$#{hook}"
-					
-					results[path] = objectOrFunction args...
-					
-			else
-				
-				invokeRecursive "#{path}/#{key}", objectOrFunction
-				
-	invokeRecursive name, package_ for name, package_ of packageCache
-	
+	results[path] = fn args... for {path, fn} in packageCache[hook] ? []
 	results

				
			throw error
			
		packageCache[name] = package_
		
	return


_packages = []

exports.rebuildPackageCache = ->
	moduleCache = {}
	packageCache = {}
	
	for name in _packages
