sebastien 6 年之前
父节点
当前提交
63c907a76b
共有 1 个文件被更改,包括 18 次插入4 次删除
  1. 18 4
      Tools/Gulp/helpers/gulp-rmDir.js

+ 18 - 4
Tools/Gulp/helpers/gulp-rmDir.js

@@ -24,8 +24,22 @@ var rmDir = function(dirPath) {
 }
 
 module.exports = function(dirPath) {
-    // Retry :-)
-    rmDir(dirPath);
-    rmDir(dirPath);
-    rmDir(dirPath);
+    // Retry cause  sometimes locked on my mac :-)
+    try {
+        rmDir(dirPath);
+    }
+    catch (e) {
+        try {
+            rmDir(dirPath);
+        }
+        catch (e) {
+            try {
+                rmDir(dirPath);
+            }
+            catch (e) {
+                // Something is definitely wrong here.
+                throw e;
+            }
+        } 
+    }
 };