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
12 changes: 4 additions & 8 deletions src/dotnet-nugetize/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,10 @@ bool isSolution(string file) => file.EndsWith(".sln", StringComparison.OrdinalIg
}

var doc = XDocument.Load(file);
Tree? root = default;

if (contentsOnly)
{
root = new Tree("[yellow]Package Contents[/]");
var root = new Tree("[yellow]Package Contents[/]");

if (project.EndsWith(".sln"))
AnsiConsole.Write(new Paragraph($"Solution {Path.GetFileName(project)} contains only non-packable project(s), rendering contributed package contents.", errorStyle));
Expand All @@ -225,6 +224,7 @@ bool isSolution(string file) => file.EndsWith(".sln", StringComparison.OrdinalIg
.ThenBy(x => x.Element("PackagePath").Value);

AddContents(root.AddNode("[yellow]Contents:[/]"), contents.ToList());
AnsiConsole.Write(root);
}
else
{
Expand Down Expand Up @@ -254,7 +254,7 @@ bool isSolution(string file) => file.EndsWith(".sln", StringComparison.OrdinalIg
.AddRow(new Text(specFile,
new Style(Color.Blue, decoration: Decoration.Underline, link: new FileInfo(metadata.Element("Nuspec").Value).FullName))));

root = new Tree(grid);
var root = new Tree(grid);

var width = metadata.Elements()
.Select(x => x.Name.LocalName.Length)
Expand Down Expand Up @@ -312,8 +312,7 @@ bool isSolution(string file) => file.EndsWith(".sln", StringComparison.OrdinalIg
.ThenBy(x => x.Element("PackagePath").Value);

AddContents(root.AddNode("[yellow]Contents:[/]"), contents.ToList());
//Render(contents.ToList(), 0, 0, "");
//Console.WriteLine();
AnsiConsole.Write(new Padder(root));
}

if (!foundPackage)
Expand All @@ -323,9 +322,6 @@ bool isSolution(string file) => file.EndsWith(".sln", StringComparison.OrdinalIg
}
}

if (root != null)
AnsiConsole.Write(root);

AnsiConsole.WriteLine();
if (items != null)
AnsiConsole.WriteLine($"> [yellow]{file}[/]");
Expand Down