public List <ProjectDependency> GetDependencies(string steeltoe, string framework, string template) { var list = GetAvailableTemplates(); var selectedTemplate = list.FirstOrDefault(x => x.ShortName == template); if (selectedTemplate == null) { throw new InvalidDataException($"Could not find template with name {template} "); } var config = _mustacheConfig.GetSchema(new TemplateKey(steeltoe, framework, template)); return(config.Params .Where(p => p.Description.ToLower().Contains("steeltoe")) .Select(p => new ProjectDependency { Name = p.FriendlyName ?? GetFriendlyName(p.Name), ShortName = p.Name, Description = p.Description, }).ToList()); }
public List <ProjectDependency> GetDependencies(string shortName, TemplateVersion version) { shortName = string.IsNullOrEmpty(shortName) ? DefaultTemplateName : shortName; var list = GetAvailableTemplates(); var selectedTemplate = list.FirstOrDefault(x => x.ShortName == shortName); if (selectedTemplate == null) { throw new InvalidDataException($"Could not find template with name {shortName} "); } // var templatePath = _templatePath + Path.DirectorySeparatorChar + selectedTemplate.Name; var config = _mustacheConfig.GetSchema(new TemplateKey(selectedTemplate.Name, version)); return(config.Params .Where(p => p.Description.ToLower().Contains("steeltoe")) .Select(p => new ProjectDependency { Name = p.FriendlyName ?? GetFriendlyName(p.Name), ShortName = p.Name, Description = p.Description, }).ToList()); }