Mono/C#: Fix editor using wrong project assembly path in rare cases
We were removing invalid path characters from the name in C++ code, but the C# editor code wasn't.
This commit is contained in:
parent
4f96c65e13
commit
8bb48ae57a
|
@ -43,7 +43,7 @@ namespace GodotTools.Core
|
|||
path.StartsWith(DriveRoot, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
public static string ToSafeDirName(this string dirName, bool allowDirSeparator)
|
||||
public static string ToSafeDirName(this string dirName, bool allowDirSeparator = false)
|
||||
{
|
||||
var invalidChars = new List<string> { ":", "*", "?", "\"", "<", ">", "|" };
|
||||
|
||||
|
|
|
@ -430,7 +430,7 @@ namespace GodotTools.Export
|
|||
private static string DetermineDataDirNameForProject()
|
||||
{
|
||||
var appName = (string)ProjectSettings.GetSetting("application/config/name");
|
||||
string appNameSafe = appName.ToSafeDirName(allowDirSeparator: false);
|
||||
string appNameSafe = appName.ToSafeDirName();
|
||||
return $"data_{appNameSafe}";
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace GodotTools
|
|||
get
|
||||
{
|
||||
var projectAssemblyName = (string)ProjectSettings.GetSetting("application/config/name");
|
||||
projectAssemblyName = projectAssemblyName.ToSafeDirName();
|
||||
if (string.IsNullOrEmpty(projectAssemblyName))
|
||||
projectAssemblyName = "UnnamedProject";
|
||||
return projectAssemblyName;
|
||||
|
|
Loading…
Reference in New Issue