From 2087bccd8f39da636984a0320809083320b14809 Mon Sep 17 00:00:00 2001 From: TheCakeIsNaOH Date: Wed, 6 Sep 2023 22:38:38 -0500 Subject: [PATCH] (#1901) Display package deploymen location Displays the saved package deployment location for info and list commands. If the package has no deployemnt location, it displays nothing, and if the package was installed/upgraded before the saving feature was added, again, it does not show that line. --- src/chocolatey/infrastructure.app/services/NugetService.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index 160e569628..c04418c6f0 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -194,6 +194,7 @@ it is possible that incomplete package lists are returned from a command ChocolateyPackageMetadata packageLocalMetadata; string packageInstallLocation = null; + string softwareInstallLocation = null; if (package.PackagePath != null && !string.IsNullOrWhiteSpace(package.PackagePath)) { packageLocalMetadata = new ChocolateyPackageMetadata(package.PackagePath, _fileSystem); @@ -215,6 +216,7 @@ it is possible that incomplete package lists are returned from a command } } + softwareInstallLocation = packageInfo.SoftwareInstallLocation; } if (!config.QuietOutput) @@ -241,7 +243,7 @@ Package url{6} Tags: {9} Software Site: {10} Software License: {11}{12}{13}{14}{15}{16} - Description: {17}{18} + Description: {17}{18}{19} ".FormatWith( package.Title.EscapeCurlyBraces(), package.Published.GetValueOrDefault().UtcDateTime.ToShortDateString(), @@ -275,7 +277,8 @@ Package url{6} !string.IsNullOrWhiteSpace(package.BugTrackerUrl.ToStringSafe()) ? "{0} Issues: {1}".FormatWith(Environment.NewLine, package.BugTrackerUrl.ToStringSafe()) : string.Empty, package.Summary != null && !string.IsNullOrWhiteSpace(package.Summary.ToStringSafe()) ? "\r\n Summary: {0}".FormatWith(package.Summary.EscapeCurlyBraces().ToStringSafe()) : string.Empty, package.Description.EscapeCurlyBraces().Replace("\n ", "\n").Replace("\n", "\n "), - !string.IsNullOrWhiteSpace(package.ReleaseNotes.ToStringSafe()) ? "{0} Release Notes: {1}".FormatWith(Environment.NewLine, package.ReleaseNotes.EscapeCurlyBraces().Replace("\n ", "\n").Replace("\n", "\n ")) : string.Empty + !string.IsNullOrWhiteSpace(package.ReleaseNotes.ToStringSafe()) ? "{0} Release Notes: {1}".FormatWith(Environment.NewLine, package.ReleaseNotes.EscapeCurlyBraces().Replace("\n ", "\n").Replace("\n", "\n ")) : string.Empty, + !string.IsNullOrWhiteSpace(softwareInstallLocation) ? "{0} Software installed to: '{1}'".FormatWith(Environment.NewLine, softwareInstallLocation) : string.Empty )); } }