From 11a75589f3a979afe719e1ab3b39686e3a51b0d1 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Mon, 1 Oct 2018 01:13:38 +0900 Subject: [PATCH] Remove not found fragment --- docker-compose-generator/src/DockerComposeDefinition.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose-generator/src/DockerComposeDefinition.cs b/docker-compose-generator/src/DockerComposeDefinition.cs index bf197f4..3e8ad95 100644 --- a/docker-compose-generator/src/DockerComposeDefinition.cs +++ b/docker-compose-generator/src/DockerComposeDefinition.cs @@ -42,12 +42,13 @@ namespace DockerGenerator var serializer = new SerializerBuilder().Build(); Console.WriteLine($"With fragments:"); - foreach (var fragment in Fragments) + foreach (var fragment in Fragments.ToList()) { var fragmentPath = GetFragmentLocation(fragment); if (!File.Exists(fragmentPath)) { Console.WriteLine($"\t{fragment} not found in {fragmentPath}, ignoring..."); + Fragments.Remove(fragment); } else {