From 04829fe1b23b93d257118597104d00533e8ba0a8 Mon Sep 17 00:00:00 2001 From: Piegames <14054505+piegamesde@users.noreply.github.com> Date: Wed, 25 Apr 2018 23:31:41 +0200 Subject: [PATCH] Fix exception when deleting non-existing folders --- Assets/Scripts/Editor/BuildScript.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Editor/BuildScript.cs b/Assets/Scripts/Editor/BuildScript.cs index 872c8fe..a98612d 100644 --- a/Assets/Scripts/Editor/BuildScript.cs +++ b/Assets/Scripts/Editor/BuildScript.cs @@ -41,7 +41,8 @@ public class BuildSrcipt } public static void BuildPlatform(String platformName, BuildTarget target) { - Directory.Delete("./" + name + "_" + platformName, true); + if (Directory.Exists("./" + name + "_" + platformName)) + Directory.Delete("./" + name + "_" + platformName, true); File.Delete("./Build/DungeonDrifter_" + platformName + ".zip"); BuildPipeline.BuildPlayer(scenes, "./" + name + "_" + platformName + "/" + name, target, BuildOptions.None); //System.Diagnostics.Process.Start("zip -r Build/DungeonDrifter_" + platformName + ".zip " + platformName + "_" + platformName);