public static void Run(bool translationClean, string inputFile, string workFolder) { if (Misc.CheckFileExist(inputFile)) { return; } Misc.CheckFolderEx(workFolder); FolderTask(workFolder); // Deleting workfolders if they exist to avoid dupe mess foreach (var FreshTLFile in Directory.EnumerateFiles(@"NewCSV", "*.csv", SearchOption.AllDirectories)) { Misc.CheckFolderDel($@"{workFolder}\1translation"); Misc.CheckFolderDel($@"{workFolder}\2translation"); Misc.CheckFolderDel($@"{workFolder}\3translation"); Misc.CheckFolderDel($@"{workFolder}\4translation"); var CurrentPers = FreshTLFile.Remove(FreshTLFile.Length - 4, 4).Remove(0, 8); MergeWithUpdatedRepo.Run(translationClean, workFolder, FreshTLFile); Advmatch.Runner(true, "TLCleanWork", CurrentPers); // checking for dupe adv files FillHDupes.RunTask(true, workFolder); // Populating H-files FillComDupes.RunTask(true, workFolder); // Populating Com-files Misc.CheckFolderDel($@"{workFolder}\1translate"); Misc.CheckFileDel($@"{workFolder}\masterH.txt"); Misc.CheckFileDel($@"{workFolder}\masterCom.txt"); CleanupStyle.Runner(true, "TLCleanWork"); // Cleaning up formatting Misc.CheckFileDel($@"{workFolder}\ExportedCSV\c{CurrentPers}.csv"); // Exporting to CSV CreateSCV.Runner(true, @"TLCleanWork\3translation", "adv"); CreateSCV.Runner(true, @"TLCleanWork\3translation", "communication"); CreateSCV.Runner(true, @"TLCleanWork\3translation", "h"); // Zipping up ZipHandler.Runner(workFolder, CurrentPers); } Console.Clear(); Console.WriteLine("Completed!"); }
public static void Runner(bool translationClean, string workFolder, string charaType) { Dictionary <string, string> fileDictionary = new Dictionary <string, string>(); foreach (var advFile in Directory.EnumerateFiles($@"abdata\adv", "*.txt", SearchOption.AllDirectories)) { if (!MergeWithUpdatedRepo.CheckChar(charaType, advFile)) { continue; } string currentMD5 = Misc.CalculateMD5(advFile); string directoryIn = Path.GetDirectoryName($@"{workFolder}\1translation\{advFile}"); string directoryOut = Path.GetDirectoryName($@"{workFolder}\2translation\{advFile}"); try { fileDictionary.Add(currentMD5, directoryIn); Console.WriteLine($"New: { directoryIn}\translation.txt"); } catch (Exception) { directoryIn = fileDictionary[currentMD5]; Console.WriteLine($"Dupe: { directoryIn}\translation.txt"); } if (directoryIn.Contains(@"\30\61")) { directoryIn = directoryIn.Replace(@"\30\61", @"\00\61"); } else if (directoryIn.Contains(@"\30\62")) { directoryIn = directoryIn.Replace(@"\30\62", @"\00\62"); } Misc.CheckFolderEx(directoryOut); Misc.CheckFileDel($@"{directoryOut}\translation.txt"); File.Copy($@"{directoryIn}\translation.txt", $@"{directoryOut}\translation.txt"); } }