mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user