diff --git a/core/modules/utils/filesystem.js b/core/modules/utils/filesystem.js index 43d6039d5..8ec1554f7 100644 --- a/core/modules/utils/filesystem.js +++ b/core/modules/utils/filesystem.js @@ -23,9 +23,9 @@ exports.getSubdirectories = function(dirPath) { return null; } var subdirs = []; - $tw.utils.each(fs.readdirSync(dirPath),function(itemPath) { - if($tw.utils.isDirectory(itemPath)) { - subdirs.push(itemPath); + $tw.utils.each(fs.readdirSync(dirPath),function(item) { + if($tw.utils.isDirectory(path.resolve(dirPath,item))) { + subdirs.push(item); } }); return subdirs;