From 81cae314b435e6cff83dd5438877c29a15ba6bdb Mon Sep 17 00:00:00 2001 From: dsge Date: Sat, 30 Nov 2019 15:39:44 +0100 Subject: [PATCH] Make sure to include the path in the "Data template directory not found" error message --- .../GodotTools/GodotTools/Export/ExportPlugin.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs index aed25f5ac5c..52a07037df8 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs @@ -201,23 +201,25 @@ namespace GodotTools.Export string TemplateDirName() => $"data.mono.{platform}.{bits}.{target}"; string templateDirPath = Path.Combine(Internal.FullTemplatesDir, TemplateDirName()); + bool validTemplatePathFound = true; if (!Directory.Exists(templateDirPath)) { - templateDirPath = null; + validTemplatePathFound = false; if (isDebug) { target = "debug"; // Support both 'release_debug' and 'debug' for the template data directory name templateDirPath = Path.Combine(Internal.FullTemplatesDir, TemplateDirName()); + validTemplatePathFound = true; 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);