public void WriteTo(RecipeDefinition recipe, DeploymentSettings settings) { var recipeDirectory = settings.GetRecipeDirectory(recipe.Name); _fileSystem.CreateDirectory(recipeDirectory); var controlFilePath = FileSystem.Combine(recipeDirectory, ProfileFiles.RecipesControlFile); new FileSystem().WriteToFlatFile(controlFilePath, writer => { recipe.Dependencies.Each(d => { var line = "Dependency:{0}".ToFormat(d); writer.WriteLine(line); }); }); recipe.Hosts().Each(host => new HostWriter(_types).WriteTo(recipe.Name, host, settings)); }
public void build_the_default_ctor() { setupValidDeploymentFolderAt("dir"); //review there is a check inside of here var settings = new DeploymentSettings("dir"); settings.BottlesDirectory.ShouldEqual("dir\\bottles"); settings.RecipesDirectory.ShouldEqual("dir\\recipes"); settings.EnvironmentFile.ShouldEqual("dir\\environment.settings"); settings.TargetDirectory.ShouldEqual("dir\\target"); settings.DeploymentDirectory.ShouldEqual("dir"); settings.BottleManifestFile.ShouldEqual("dir\\bottles.manifest"); settings.ProfilesDirectory.ShouldEqual(FileSystem.Combine("dir", ProfileFiles.ProfilesDirectory)); settings.EnvironmentsDirectory.ShouldEqual(FileSystem.Combine("dir", ProfileFiles.EnvironmentsDirectory)); settings.GetHost("x", "z").ShouldEqual("dir\\recipes\\x\\z.host"); settings.GetRecipeDirectory("a").ShouldEqual("dir\\recipes\\a"); }