Skip to content

Commit

Permalink
(chocolatey#1901) Display package deploymen location
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TheCakeIsNaOH authored and gep13 committed Apr 26, 2024
1 parent fa1111f commit 2087bcc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -215,6 +216,7 @@ it is possible that incomplete package lists are returned from a command
}
}

softwareInstallLocation = packageInfo.SoftwareInstallLocation;
}

if (!config.QuietOutput)
Expand All @@ -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(),
Expand Down Expand Up @@ -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
));
}
}
Expand Down

0 comments on commit 2087bcc

Please sign in to comment.