static IList <HclElement> GetVariables(string template) { if (template == null) { return(new List <HclElement>()); } return(HclParser.HclTemplate.Parse(HclParser.NormalizeLineEndings(template)) .Children .Where(child => child.Name == "variable") .ToList()); }
public static bool IsHcl(string template) { return(!string.IsNullOrWhiteSpace(template) && HclParser.HclTemplate.TryParse(HclParser.NormalizeLineEndings(template)).WasSuccessful); }
protected string LoadFile(string fileName, string directory = "Cases") { var templatesPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, directory); return(HclParser.NormalizeLineEndings(File.ReadAllText(Path.Combine(templatesPath, fileName))).Trim()); }