Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/dotnet-nugetize/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -15,7 +13,6 @@
using Mono.Options;
using Spectre.Console;
using Spectre.Console.Rendering;
using static Devlooped.SponsorLink;
using static ThisAssembly.Strings;

namespace NuGetize;
Expand Down Expand Up @@ -396,7 +393,7 @@ void AddContents(TreeNode node, List<XElement> contents)
}

if (attributes.Count > 0)
parent.AddNode($"[white]{Path.GetFileName(file)}[/] [grey]({string.Join(',', attributes)})[/]");
parent.AddNode($"[white]{Path.GetFileName(file)}[/] [grey]({string.Join(", ", attributes)})[/]");
else
parent.AddNode($"[white]{Path.GetFileName(file)}[/]");
}
Expand All @@ -413,7 +410,16 @@ void AddDependencies(Tree root, List<XElement> dependencies)
var tf = deps.AddNode($"[green]{group.Key}[/]");
foreach (var dependency in group)
{
tf.AddNode(Markup.FromInterpolated($"[white]{dependency.Attribute("Include").Value}[/], [grey]{dependency.Element("Version").Value}[/]"));
var attributes = new List<string>();
if (dependency.Element("PackInclude")?.Value is string include && !string.IsNullOrEmpty(include))
attributes.Add("include=" + include);
if (dependency.Element("PackExclude")?.Value is string exclude && !string.IsNullOrEmpty(exclude))
attributes.Add("exclude=" + exclude);

if (attributes.Count > 0)
tf.AddNode(Markup.FromInterpolated($"[white]{dependency.Attribute("Include").Value}[/], [grey]{dependency.Element("Version").Value}[/] [grey]({string.Join(", ", attributes)})[/]"));
else
tf.AddNode(Markup.FromInterpolated($"[white]{dependency.Attribute("Include").Value}[/], [grey]{dependency.Element("Version").Value}[/]"));
}
}
}
Expand Down