From 3b3daf0e25727136a512091a2307e44ccb69f908 Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Thu, 10 Dec 2020 11:41:50 -0500 Subject: [PATCH 1/3] Delete old bleeding edge builds on update --- core/src/mindustry/net/BeControl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/mindustry/net/BeControl.java b/core/src/mindustry/net/BeControl.java index a15ada94bc..43be195456 100644 --- a/core/src/mindustry/net/BeControl.java +++ b/core/src/mindustry/net/BeControl.java @@ -49,6 +49,8 @@ public class BeControl{ try{ Fi dest = Fi.get(System.getProperty("becopy")); Fi self = Fi.get(BeControl.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()); + + for(Fi file : self.parent().findAll(f -> f != self)) file.delete(); self.copyTo(dest); }catch(Throwable e){ From 0f8304674f8f9668b8f4eeef0ef5c59a95252289 Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Thu, 10 Dec 2020 11:54:47 -0500 Subject: [PATCH 2/3] now 100% less readable --- core/src/mindustry/net/BeControl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/net/BeControl.java b/core/src/mindustry/net/BeControl.java index 43be195456..bd4aa150b1 100644 --- a/core/src/mindustry/net/BeControl.java +++ b/core/src/mindustry/net/BeControl.java @@ -50,7 +50,7 @@ public class BeControl{ Fi dest = Fi.get(System.getProperty("becopy")); Fi self = Fi.get(BeControl.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()); - for(Fi file : self.parent().findAll(f -> f != self)) file.delete(); + self.parent().findAll(f -> f != self).forEach(Fi::delete); self.copyTo(dest); }catch(Throwable e){ From b3beb92557d9f5e177148a060625a2132d0e0bd9 Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Thu, 10 Dec 2020 12:18:11 -0500 Subject: [PATCH 3/3] fixed --- core/src/mindustry/net/BeControl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/net/BeControl.java b/core/src/mindustry/net/BeControl.java index bd4aa150b1..768b3547fd 100644 --- a/core/src/mindustry/net/BeControl.java +++ b/core/src/mindustry/net/BeControl.java @@ -50,7 +50,7 @@ public class BeControl{ Fi dest = Fi.get(System.getProperty("becopy")); Fi self = Fi.get(BeControl.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()); - self.parent().findAll(f -> f != self).forEach(Fi::delete); + for(Fi file : self.parent().findAll(f -> !f.equals(self))) file.delete(); self.copyTo(dest); }catch(Throwable e){