From 20ad33e69c9fa6a65f8d1322cc167f60fb9cbb68 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 1 Apr 2017 15:39:43 -0700 Subject: [PATCH] [DatFile] Fix file output on inplace --- .../Dats/Partials/DatFile.ConvertUpdate.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/SabreTools.Helper/Dats/Partials/DatFile.ConvertUpdate.cs b/SabreTools.Helper/Dats/Partials/DatFile.ConvertUpdate.cs index 9d10480a..d5178976 100644 --- a/SabreTools.Helper/Dats/Partials/DatFile.ConvertUpdate.cs +++ b/SabreTools.Helper/Dats/Partials/DatFile.ConvertUpdate.cs @@ -483,14 +483,14 @@ namespace SabreTools.Helper.Dats inputFileName = Path.GetFullPath(inputFileName); } - // If inplace is set, override the output dir - if (inplace) - { - outDir = Path.GetDirectoryName(inputFileName); - } - if (File.Exists(inputFileName)) { + // If inplace is set, override the output dir + if (inplace) + { + outDir = Path.GetDirectoryName(inputFileName); + } + DatFile innerDatdata = new DatFile(this); Globals.Logger.User("Processing \"" + Path.GetFileName(inputFileName) + "\""); innerDatdata.Parse(inputFileName, 0, 0, splitType, keep: true, clean: clean, remUnicode: remUnicode, descAsName: descAsName, @@ -507,6 +507,12 @@ namespace SabreTools.Helper.Dats List subFiles = Directory.EnumerateFiles(inputFileName, "*", SearchOption.AllDirectories).ToList(); Parallel.ForEach(subFiles, Globals.ParallelOptions, file => { + // If inplace is set, override the output dir + if (inplace) + { + outDir = Path.GetDirectoryName(file); + } + Globals.Logger.User("Processing \"" + Path.GetFullPath(file).Remove(0, inputFileName.Length) + "\""); DatFile innerDatdata = new DatFile(this); innerDatdata.Parse(file, 0, 0, splitType, true, clean, descAsName,