Merge pull request #22865 from neikeq/issue-22854

Check if directory exists before trying to delete it
This commit is contained in:
Ignacio Etcheverry 2018-10-08 23:33:25 +02:00 committed by GitHub
commit e6cfaa18ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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)));