diff --git a/lib/utils.js b/lib/utils.js index 5d81148..f4a20dd 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -16,7 +16,12 @@ exports.loadFiles = function(dir, pattern) { dir = !Array.isArray(dir) ? [dir] : dir; for (var i in dir) { - files = files.concat(glob.sync(path.join(process.cwd(), dir[i], pattern))); + var filePath = [process.cwd(), dir[i], pattern]; + if(path.isAbsolute(dir[i])) { + filePath.shift(); + } + + files = files.concat(glob.sync(path.join.apply(null, filePath))); } return files;