public void Validate(ReadmeFile file) { var latestMetadataFile = MetadataFile.ReadFromFileSystem(this.fileSystem); var latestReadmeFile = ReadmeFile.Generate(this.fileSystem, latestMetadataFile, latestMainArmTemplateFile); this.Validate(file.Path, file.Content, latestReadmeFile.Content); }
protected override int Invoke(InvocationContext context) { // Read or create main Bicep file. this.Logger.LogInformation("Ensure {MainBicepFile} exists...", "main Bicep file"); var mainBicepFile = MainBicepFile.EnsureInFileSystem(this.FileSystem); // Read or create metadata file. this.Logger.LogInformation("Ensure {MetadataFile} exists...", "metadata file"); var metadataFile = MetadataFile.EnsureInFileSystem(this.FileSystem); // Generate main ARM template file. var bicepCliProxy = new BicepCliProxy(this.environmentProxy, this.processProxy, this.FileSystem, this.Logger, context.Console); var mainArmTemplateFile = this.GenerateFileAndLogInformation("main ARM template file", () => MainArmTemplateFile .Generate(this.FileSystem, bicepCliProxy, mainBicepFile) .WriteToFileSystem(FileSystem)); // Generate main ARM template parameters file. var mainArmTemplateParametersFile = this.GenerateFileAndLogInformation("main ARM template parameters file", () => MainArmTemplateParametersFile .Generate(this.FileSystem, mainArmTemplateFile) .WriteToFileSystem(this.FileSystem)); // Generate README file. this.GenerateFileAndLogInformation("README file", () => ReadmeFile .Generate(this.FileSystem, metadataFile, mainArmTemplateFile) .WriteToFileSystem(this.FileSystem)); // Generate version file. this.GenerateFileAndLogInformation("version file", () => VersionFile .Generate(this.FileSystem) .WriteToFileSystem(this.FileSystem)); return(0); }