[DatFIle, Utilities] Order in the Force

So this change is deceptively simple but could help solve a lot of issues. First is that in most cases, the default is now that output DATs do not overwrite what is already in the current folder. This should be able to help in cases where multiple folders are being output to the same folder during updates. The second is that now, if the output path is the current directory AND there was a directory input, the lowest directory name is now used as a subfolder in the current directory. This helps get rid of even more issues when an output directory is not set.
This commit is contained in:
Matt Nadareski
2018-04-25 14:34:25 -07:00
parent 1da75651d3
commit 3731a57796
2 changed files with 17 additions and 13 deletions

View File

@@ -2721,6 +2721,13 @@ namespace SabreTools.Library.Tools
outDir = Path.GetDirectoryName(split[1]);
}
// TODO: Should this be the default? Always create a subfolder if a folder is found?
// If we are processing a path that is coming from a directory and we are outputting to the current directory, we want to get the subfolder to write to
else if (split[0].Length != split[1].Length && outDir == Environment.CurrentDirectory)
{
outDir = Path.GetDirectoryName(Path.Combine(outDir, split[0].Remove(0, Path.GetDirectoryName(split[1]).Length + 1)));
}
// If we are processing a path that is coming from a directory, we want to get the subfolder to write to
else if (split[0].Length != split[1].Length)
{