sebastien 6 years ago
parent
commit
63c907a76b
1 changed files with 18 additions and 4 deletions
  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) {
 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;
+            }
+        } 
+    }
 };
 };