public override void Write(CustomFileWriter writer)
        {
            writer.WriteLine(Kind.GetValue() + ":");

            using (writer.Indent())
            {
                if (Branches.Length > 0)
                {
                    writer.WriteLine("branches:");
                    using (writer.Indent())
                    {
                        Branches.ForEach(x => writer.WriteLine($"- {x}"));
                    }
                }

                if (Tags.Length > 0)
                {
                    writer.WriteLine("tags:");
                    using (writer.Indent())
                    {
                        Tags.ForEach(x => writer.WriteLine($"- {x}"));
                    }
                }

                if (IncludePaths.Length > 0 || ExcludePaths.Length > 0)
                {
                    writer.WriteLine("paths:");
                    using (writer.Indent())
                    {
                        IncludePaths.ForEach(x => writer.WriteLine($"- {x}"));
                        ExcludePaths.ForEach(x => writer.WriteLine($"- !{x}"));
                    }
                }
            }
        }
Пример #2
0
        public override void Write(CustomFileWriter writer)
        {
            writer.WriteLine($"{Kind.GetValue()}:");

            void WriteValue(string value) => writer.WriteLine($"- {value.SingleQuoteIfNeeded('*', '!')}");

            using (writer.Indent())
            {
                if (Branches.Length > 0)
                {
                    writer.WriteLine("branches:");
                    using (writer.Indent())
                    {
                        Branches.ForEach(WriteValue);
                    }
                }

                if (BranchesIgnore.Length > 0)
                {
                    writer.WriteLine("branches-ignore:");
                    using (writer.Indent())
                    {
                        BranchesIgnore.ForEach(WriteValue);
                    }
                }

                if (Tags.Length > 0)
                {
                    writer.WriteLine("tags:");
                    using (writer.Indent())
                    {
                        Tags.ForEach(WriteValue);
                    }
                }

                if (TagsIgnore.Length > 0)
                {
                    writer.WriteLine("tags-ignore:");
                    using (writer.Indent())
                    {
                        TagsIgnore.ForEach(WriteValue);
                    }
                }

                if (IncludePaths.Length > 0 || ExcludePaths.Length > 0)
                {
                    writer.WriteLine("paths:");
                    using (writer.Indent())
                    {
                        IncludePaths.ForEach(WriteValue);
                        ExcludePaths.Select(x => $"!{x}").ForEach(WriteValue);
                    }
                }
            }
        }