瀏覽代碼

Merge pull request #34018 from dsge/show-template-directory-path-in-error-message

Make sure to include the path in the "Data template directory not found" error message
Ignacio Roldán Etcheverry 5 年之前
父節點
當前提交
6544a0e908
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs

+ 6 - 4
modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs

@@ -209,23 +209,25 @@ namespace GodotTools.Export
             string TemplateDirName() => $"data.mono.{platform}.{bits}.{target}";
             string TemplateDirName() => $"data.mono.{platform}.{bits}.{target}";
 
 
             string templateDirPath = Path.Combine(Internal.FullTemplatesDir, TemplateDirName());
             string templateDirPath = Path.Combine(Internal.FullTemplatesDir, TemplateDirName());
+            bool validTemplatePathFound = true;
 
 
             if (!Directory.Exists(templateDirPath))
             if (!Directory.Exists(templateDirPath))
             {
             {
-                templateDirPath = null;
+                validTemplatePathFound = false;
 
 
                 if (isDebug)
                 if (isDebug)
                 {
                 {
                     target = "debug"; // Support both 'release_debug' and 'debug' for the template data directory name
                     target = "debug"; // Support both 'release_debug' and 'debug' for the template data directory name
                     templateDirPath = Path.Combine(Internal.FullTemplatesDir, TemplateDirName());
                     templateDirPath = Path.Combine(Internal.FullTemplatesDir, TemplateDirName());
+                    validTemplatePathFound = true;
 
 
                     if (!Directory.Exists(templateDirPath))
                     if (!Directory.Exists(templateDirPath))
-                        templateDirPath = null;
+                        validTemplatePathFound = false;
                 }
                 }
             }
             }
 
 
-            if (templateDirPath == null)
-                throw new FileNotFoundException("Data template directory not found");
+            if (!validTemplatePathFound)
+                throw new FileNotFoundException("Data template directory not found", templateDirPath);
 
 
             string outputDataDir = Path.Combine(outputDir, DataDirName);
             string outputDataDir = Path.Combine(outputDir, DataDirName);