Use easier-to-read syntax in BaseFeature

This commit is contained in:
Matt Nadareski
2025-04-18 09:58:54 -04:00
parent 0731c3ca15
commit 2fb7951488
2 changed files with 737 additions and 1445 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -82,35 +82,36 @@ namespace SabreTools.Features
// For each input directory, create a DAT
foreach (string path in Inputs)
{
if (Directory.Exists(path) || File.Exists(path))
// TODO: Should this be logged?
if (!Directory.Exists(path) && !File.Exists(path))
continue;
// Clone the base Dat for information
DatFile datdata = Parser.CreateDatFile(basedat.Header, basedat.Modifiers);
// Get the base path and fill the header, if needed
string basePath = Path.GetFullPath(path);
datdata.FillHeaderFromPath(basePath, noAutomaticDate);
// Now populate from the path
bool success = dfd.PopulateFromDir(datdata, basePath);
if (success)
{
// Clone the base Dat for information
DatFile datdata = Parser.CreateDatFile(basedat.Header, basedat.Modifiers);
// Perform additional processing steps
Extras!.ApplyExtras(datdata);
Extras!.ApplyExtrasDB(datdata);
Splitter!.ApplySplitting(datdata, useTags: false);
datdata.ExecuteFilters(FilterRunner!);
Cleaner!.ApplyCleaning(datdata);
Remover!.ApplyRemovals(datdata);
// Get the base path and fill the header, if needed
string basePath = Path.GetFullPath(path);
datdata.FillHeaderFromPath(basePath, noAutomaticDate);
// Now populate from the path
bool success = dfd.PopulateFromDir(datdata, basePath);
if (success)
{
// Perform additional processing steps
Extras!.ApplyExtras(datdata);
Extras!.ApplyExtrasDB(datdata);
Splitter!.ApplySplitting(datdata, useTags: false);
datdata.ExecuteFilters(FilterRunner!);
Cleaner!.ApplyCleaning(datdata);
Remover!.ApplyRemovals(datdata);
// Write out the file
Writer.Write(datdata, OutputDir);
}
else
{
Console.WriteLine();
OutputRecursive(0);
}
// Write out the file
Writer.Write(datdata, OutputDir);
}
else
{
Console.WriteLine();
OutputRecursive(0);
}
}