From 9dfcb9e858f1d81f96ed73e78a7252fe0f8f3cc7 Mon Sep 17 00:00:00 2001 From: TheCakeIsNaOH Date: Thu, 22 Dec 2022 09:58:45 -0600 Subject: [PATCH] (#508) Tweak info/verbose list output This makes the info output the same as it was when using NuGet.Core so as to keep the info output the same as it is with v1.x --- .../infrastructure.app/services/NugetService.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index fcbf2c92e7..1687fb06b6 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -198,7 +198,7 @@ public virtual IEnumerable list_run(ChocolateyConfiguration confi if (config.Verbose && !config.ListCommand.IdOnly) this.Log().Info(() => @" Title: {0} | Published: {1}{2}{3} Number of Downloads: {4} | Downloads for this version: {5} - Package url: {6} + Package url{6} Chocolatey Package Source: {7}{8} Tags: {9} Software Site: {10} @@ -217,12 +217,12 @@ public virtual IEnumerable list_run(ChocolateyConfiguration confi package.PackageTestResultStatus, package.PackageValidationResultDate.GetValueOrDefault().ToString("MMM dd yyyy HH:mm:ss") ), - package.DownloadCount <= 0 ? "n/a" : package.DownloadCount.to_string(), - package.VersionDownloadCount <= 0 ? "n/a" : package.VersionDownloadCount.to_string(), - package.PackageDetailsUrl == null || string.IsNullOrWhiteSpace(package.PackageDetailsUrl.AbsoluteUri) ? "N/A" : package.PackageDetailsUrl.AbsoluteUri, + (package.DownloadCount == null || package.DownloadCount <= 0) ? "n/a" : package.DownloadCount.to_string(), + (package.VersionDownloadCount == null || package.VersionDownloadCount <= 0) ? "n/a" : package.VersionDownloadCount.to_string(), + package.PackageDetailsUrl == null || string.IsNullOrWhiteSpace(package.PackageDetailsUrl.AbsoluteUri) ? string.Empty : " " + package.PackageDetailsUrl.AbsoluteUri, packageLocalMetadata != null && packageLocalMetadata.PackageSourceUrl != null && !string.IsNullOrWhiteSpace(packageLocalMetadata.PackageSourceUrl.to_string()) ? packageLocalMetadata.PackageSourceUrl.to_string() - : "N/A", + : "n/a", string.IsNullOrWhiteSpace(package.PackageHash) ? string.Empty : "{0} Package Checksum: '{1}' ({2})".format_with( Environment.NewLine, package.PackageHash, @@ -235,7 +235,7 @@ public virtual IEnumerable list_run(ChocolateyConfiguration confi packageLocalMetadata != null && packageLocalMetadata.DocsUrl != null && !string.IsNullOrWhiteSpace(packageLocalMetadata.DocsUrl.to_string()) ? "{0} Documentation: {1}".format_with(Environment.NewLine, packageLocalMetadata.DocsUrl.to_string()) : string.Empty, packageLocalMetadata != null && packageLocalMetadata.MailingListUrl != null && !string.IsNullOrWhiteSpace(packageLocalMetadata.MailingListUrl.to_string()) ? "{0} Mailing List: {1}".format_with(Environment.NewLine, packageLocalMetadata.MailingListUrl.to_string()) : string.Empty, packageLocalMetadata != null && packageLocalMetadata.BugTrackerUrl != null && !string.IsNullOrWhiteSpace(packageLocalMetadata.BugTrackerUrl.to_string()) ? "{0} Issues: {1}".format_with(Environment.NewLine, packageLocalMetadata.BugTrackerUrl.to_string()) : string.Empty, - package.Summary != null && !string.IsNullOrWhiteSpace(package.Summary.to_string()) ? "{0} Summary: {1}".format_with(Environment.NewLine, package.Summary.escape_curly_braces().to_string()) : string.Empty, + package.Summary != null && !string.IsNullOrWhiteSpace(package.Summary.to_string()) ? "\r\n Summary: {0}".format_with(package.Summary.escape_curly_braces().to_string()) : string.Empty, package.Description.escape_curly_braces().Replace("\n ", "\n").Replace("\n", "\n "), packageLocalMetadata != null && packageLocalMetadata.ReleaseNotes != null && !string.IsNullOrWhiteSpace(packageLocalMetadata.ReleaseNotes.to_string()) ? "{0} Release Notes: {1}".format_with(Environment.NewLine, packageLocalMetadata.ReleaseNotes.escape_curly_braces().Replace("\n ", "\n").Replace("\n", "\n ")) : string.Empty ));