Skip to content

Commit

Permalink
(chocolatey#2781) Add chocolateyPackageId to env variables
Browse files Browse the repository at this point in the history
Previously the only env variable to reference a Chocolatey package id
was $env:ChocolateyPackageName. This is inconsistent with the nusepec
file where it is referenced as id.

This commit adds chocolateyPackageId and packageId to the available
environment variables available inside the PowerShell host allowing a
package maintainer to reference the id of a package with the more
idiomatic $env:ChocolateyPackageId.
  • Loading branch information
steviecoaster committed Nov 11, 2022
1 parent 7e23ae6 commit 0f8434c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ public void prepare_powershell_environment(IPackage package, ChocolateyConfigura

Environment.SetEnvironmentVariable("chocolateyPackageName", package.Id);
Environment.SetEnvironmentVariable("packageName", package.Id);
Environment.SetEnvironmentVariable("chocolateyPackageId", package.Id);
Environment.SetEnvironmentVariable("packageId", package.Id);
Environment.SetEnvironmentVariable("chocolateyPackageTitle", package.Title);
Environment.SetEnvironmentVariable("packageTitle", package.Title);
Environment.SetEnvironmentVariable("chocolateyPackageVersion", package.Version.to_string());
Expand Down

0 comments on commit 0f8434c

Please sign in to comment.