private static async Task <IEnumerable <string> > CreateFiles(EnvSettings.SystemSettings systemSettings, EnvSettings.AppSettings appSettings) { var allGenerators = FileTemplate.GetAllGenerators(systemSettings, appSettings); List <Task> genTasks = new List <Task>(); foreach (var item in allGenerators) { genTasks.Add(item.Value.WriteFileAsync()); } await Task.WhenAll(genTasks); return(allGenerators.Select(x => x.Value.GetFilePath())); }
private static Task DeleteServiceAsync(EnvSettings.SystemSettings systemSettings, EnvSettings.AppSettings appSettings) { $"systemctl stop {appSettings.ProjectName}".Bash(); var generators = FileTemplate.GetAllGenerators(systemSettings, appSettings); foreach (var gen in generators) { File.Delete(gen.Value.GetFilePath()); if (gen.Value is NginxTemplate) { ((NginxTemplate)gen.Value).DisableSite(); } } Directory.Delete(appSettings.GetWWWLE(), true); "service nginx reload".Bash(); return(Task.CompletedTask); }