diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2018-10-08 23:03:58 +0200 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2018-10-08 23:03:58 +0200 |
commit | 3a9b23bcc29d60b332f9e681d1b2dcad818694f2 (patch) | |
tree | 7b3ba73ad2b35702a132b804110d2d285c716e72 /modules/mono/editor/GodotSharpTools | |
parent | b17e71b6e5e035f49b5b3b5b55b9cdac80215d72 (diff) |
Check if directory exists before trying to delete it
Diffstat (limited to 'modules/mono/editor/GodotSharpTools')
-rw-r--r-- | modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs | 6 |
1 files changed, 4 insertions, 2 deletions
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))); |