Merge pull request #22865 from neikeq/issue-22854
Check if directory exists before trying to delete it
This commit is contained in:
commit
e6cfaa18ca
|
@ -41,9 +41,11 @@ namespace GodotSharpTools.Editor
|
||||||
|
|
||||||
string outputDataDir = Path.Combine(outputDir, GetDataDirName());
|
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);
|
Directory.CreateDirectory(outputDataDir);
|
||||||
|
|
||||||
foreach (string dir in Directory.GetDirectories(templateDirPath, "*", SearchOption.AllDirectories))
|
foreach (string dir in Directory.GetDirectories(templateDirPath, "*", SearchOption.AllDirectories))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(Path.Combine(outputDataDir, dir.Substring(templateDirPath.Length + 1)));
|
Directory.CreateDirectory(Path.Combine(outputDataDir, dir.Substring(templateDirPath.Length + 1)));
|
||||||
|
|
Loading…
Reference in New Issue