mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Fix issue with trimmed folder names being empty.
This commit is contained in:
parent
d24e1576d3
commit
52efacacd7
1 changed files with 4 additions and 1 deletions
|
|
@ -332,7 +332,10 @@ public partial class ModCreator
|
|||
|
||||
/// <summary> Return the name of a new valid directory based on the base directory and the given name. </summary>
|
||||
public static DirectoryInfo NewOptionDirectory(DirectoryInfo baseDir, string optionName)
|
||||
=> new(Path.Combine(baseDir.FullName, ReplaceBadXivSymbols(optionName)));
|
||||
{
|
||||
var option = ReplaceBadXivSymbols(optionName);
|
||||
return new DirectoryInfo(Path.Combine(baseDir.FullName, option.Length > 0 ? option : "_"));
|
||||
}
|
||||
|
||||
/// <summary> Normalize for nicer names, and remove invalid symbols or invalid paths. </summary>
|
||||
public static string ReplaceBadXivSymbols(string s, string replacement = "_")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue