Browse Source

Remove not found fragment

feature/auto_ssh
nicolas.dorier 6 years ago
parent
commit
eb6fa9271e
  1. 3
      docker-compose-generator/src/DockerComposeDefinition.cs

3
docker-compose-generator/src/DockerComposeDefinition.cs

@ -42,12 +42,13 @@ namespace DockerGenerator
var serializer = new SerializerBuilder().Build(); var serializer = new SerializerBuilder().Build();
Console.WriteLine($"With fragments:"); Console.WriteLine($"With fragments:");
foreach (var fragment in Fragments) foreach (var fragment in Fragments.ToList())
{ {
var fragmentPath = GetFragmentLocation(fragment); var fragmentPath = GetFragmentLocation(fragment);
if (!File.Exists(fragmentPath)) if (!File.Exists(fragmentPath))
{ {
Console.WriteLine($"\t{fragment} not found in {fragmentPath}, ignoring..."); Console.WriteLine($"\t{fragment} not found in {fragmentPath}, ignoring...");
Fragments.Remove(fragment);
} }
else else
{ {

Loading…
Cancel
Save