mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Root directories are weird (Fixes #163)
This commit is contained in:
@@ -273,6 +273,16 @@ namespace DICUI.Utilities
|
||||
// If we had a directory separator at the end before, add it again
|
||||
if (endedWithDirectorySeparator)
|
||||
OutputDirectory += Path.DirectorySeparatorChar;
|
||||
|
||||
// If we have a root directory, sanitize
|
||||
if (Directory.Exists(OutputDirectory))
|
||||
{
|
||||
var possibleRootDir = new DirectoryInfo(OutputDirectory);
|
||||
if (possibleRootDir.Parent == null)
|
||||
{
|
||||
OutputDirectory = OutputDirectory.Replace($"{Path.DirectorySeparatorChar}{Path.DirectorySeparatorChar}", $"{Path.DirectorySeparatorChar}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user