possible fix for path.commonPrefix issue (#330)

This commit is contained in:
Jeff Williams 2013-01-30 18:03:46 -08:00
parent f09ef82246
commit a8d7cd5bdf

View File

@ -16,9 +16,9 @@ function prefixReducer(previousPath, current) {
return currentPath; return currentPath;
} }
currentPath = path.resolve( process.cwd(), path.dirname(current) ).split(path.sep); currentPath = path.resolve( process.cwd(), path.dirname(current) ).split(path.sep) || [];
if (previousPath) { if (previousPath && currentPath.length) {
// remove chunks that exceed the previous path's length // remove chunks that exceed the previous path's length
currentPath = currentPath.slice(0, previousPath.length); currentPath = currentPath.slice(0, previousPath.length);