static void MigrateServerMods(IEnumerable<string> folders, IAbsoluteDirectoryPath modPath, StatusRepo statusRepo) { foreach (var folder in folders) { foreach (var modFolder in Directory.EnumerateDirectories(folder)) { var status = new Status(Path.GetFileName(modFolder), statusRepo) {Action = RepoStatus.Processing}; MigrateServerModFolder(modFolder.ToAbsoluteDirectoryPath(), modPath); status.Progress = 100; } Directory.Delete(folder, true); } }
Task FetchFileAsyncWithStatus(string file, string filePath, string destination, CancellationTokenSource token) { var status = new Status.Status(file, _statusRepo) { RealObject = filePath }; var f = Path.Combine(destination, filePath).ToAbsoluteFilePath(); status.StartOutput(f.ToString()); return(TryFetchFileAsyncWithStatus(GetSpec(file, f, status), token)); }
static void Status(string patchFile, StatusRepo repo, Action<IStatus> act, RepoStatus action = RepoStatus.Downloading) { var status = new Status(patchFile, repo) {Action = action}; act(status); status.EndOutput(); }