diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index ae44b765..52213262 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -13,12 +13,7 @@ namespace DepotDownloader { class Program { - static int Main(string[] args) - => MainAsync(args).GetAwaiter().GetResult(); - - internal static readonly char[] newLineCharacters = ['\n', '\r']; - - static async Task MainAsync(string[] args) + static async Task Main(string[] args) { if (args.Length == 0) { @@ -71,15 +66,19 @@ namespace DepotDownloader try { - var fileListData = await File.ReadAllTextAsync(fileList); - var files = fileListData.Split(newLineCharacters, StringSplitOptions.RemoveEmptyEntries); - ContentDownloader.Config.UsingFileList = true; ContentDownloader.Config.FilesToDownload = new HashSet(StringComparer.OrdinalIgnoreCase); ContentDownloader.Config.FilesToDownloadRegex = []; + var files = await File.ReadAllLinesAsync(fileList); + foreach (var fileEntry in files) { + if (string.IsNullOrWhiteSpace(fileEntry)) + { + continue; + } + if (fileEntry.StartsWith(RegexPrefix)) { var rgx = new Regex(fileEntry[RegexPrefix.Length..], RegexOptions.Compiled | RegexOptions.IgnoreCase);