From 3a9b23bcc29d60b332f9e681d1b2dcad818694f2 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Mon, 8 Oct 2018 23:03:58 +0200 Subject: Check if directory exists before trying to delete it --- modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules/mono/editor/GodotSharpTools') diff --git a/modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs b/modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs index 9f0d562ef7..5fd708d539 100644 --- a/modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs +++ b/modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs @@ -41,9 +41,11 @@ namespace GodotSharpTools.Editor string outputDataDir = Path.Combine(outputDir, GetDataDirName()); - Directory.Delete(outputDataDir, recursive: true); // Clean first + if (Directory.Exists(outputDataDir)) + Directory.Delete(outputDataDir, recursive: true); // Clean first + Directory.CreateDirectory(outputDataDir); - + foreach (string dir in Directory.GetDirectories(templateDirPath, "*", SearchOption.AllDirectories)) { Directory.CreateDirectory(Path.Combine(outputDataDir, dir.Substring(templateDirPath.Length + 1))); -- cgit v1.2.3