lishihao 13 часов назад
Родитель
Сommit
3517919a4c
2 измененных файлов с 9 добавлено и 12 удалено
  1. 8 11
      modules/common/fileUtils.js
  2. 1 1
      package.json

+ 8 - 11
modules/common/fileUtils.js

@@ -29,17 +29,14 @@ module.exports.getGlobbedFiles = function(globPatterns, removeRoot) {
 		if (urlRegex.test(globPatterns)) {
 			output.push(globPatterns);
 		} else {
-			glob(globPatterns, {
-				sync: true
-			}, function(err, files) {
-				if (removeRoot) {
-					files = files.map(function(file) {
-						return file.replace(removeRoot, '');
-					});
-				}
-
-				output = _.union(output, files);
-			});
+			var files = glob.sync(globPatterns);
+			if (removeRoot) {
+				files = files.map(function(file) {
+					return file.replace(removeRoot, '');
+				});
+			}
+
+			output = _.union(output, files);
 		}
 	}
 

+ 1 - 1
package.json

@@ -14,7 +14,7 @@
     "express": "^4.13.1",
     "express-partials": "^0.3.0",
     "express-session": "^1.15.1",
-    "glob": "~4.0.5",
+    "glob": "^7.2.3",
     "lodash": "^4.17.21",
     "moment": "^2.18.1",
     "mongoose": "~4.13.12",