public void Write(SliceSection section, StringBuilder sb) { if (section.SectionType == SliceSection.Type.RUN) { foreach (var line in section.Lines) { sb.AppendLine(line); } } }
public void Write(SliceSection section, StringBuilder sb) { if (section.SectionType != SliceSection.Type.RUN) { foreach (var line in section.Lines.Where(item => !item.StartsWith("#"))) { sb.Append(section.SectionType).Append(" ").AppendLine(line); } } if (section.SectionType == SliceSection.Type.RUN) { var text = string.Join($" && {"\\"} {Environment.NewLine}", section.Lines.Where(item => !item.StartsWith("#"))); sb.Append("RUN "); sb.AppendLine(text); } }
public void Write(SliceSection section, StringBuilder sb) { if (section.SectionType == SliceSection.Type.FROM) { foreach (var line in section.Lines) { sb.Append("FROM ").AppendLine(line); } } if (section.SectionType == SliceSection.Type.RUN) { var text = string.Join($" && {"\\"} {Environment.NewLine}", section.Lines); sb.Append("RUN "); sb.AppendLine(text); } }