           return next 'must be in a workspace to lint your package'
         pkg_path = path.join workspace, 'pkg', id, version
         return next 'package not found' unless fs.existsSync pkg_path
-        next null, pkg_path
-
-    collectFiles = (path, next) ->
-      return next null, [path] if target_type is 'file'
-      files = []
-      ignored_dirs = ['.git', 'node_modules']
-
-      finder = findit path
-      finder.on 'directory', (dir, stat, stop) -> stop() if dir in ignored_dirs
-      finder.on 'file', (file) -> files.push file
-      finder.on 'end', -> next null, files
+        next null, [{path: pkg_path, type: 'directory'}]
+
+    collectFiles = (paths, done) ->
+      async.concat paths, ((item, next) ->
+        {type, path} = item
+        switch type
+
+          when 'file'
+            next null, path
+
+          when 'directory'
+            files = []
+            ignored_dirs = ['.git', 'node_modules']
+
+            finder = findit path
+            finder.on 'directory', (dir, stat, stop) ->
+              stop() if dir in ignored_dirs
+            finder.on 'file', (file) ->
+              files.push file
+            finder.on 'end', ->
+              next null, files
+
+      ), (err, files) ->
+        return done err if err
+        done null, files
 
     lintPath = (files, done) ->
       success = true

readline = require 'readline'
request = require 'request'
xml2js = require 'xml2js'


# usage
USAGE = """

###
# dependencies
CSON = require 'cson'
Firebase = require 'firebase'
