Skip to content

Commit

Permalink
fix: Set environment variables used by pre/postgeneration scripts
Browse files Browse the repository at this point in the history
These were removed when refactoring GenerateApisCommand, as that
no longer picks the values up from the environment when provided
with a root layout - but we still want to be able to refer to them
from the scripts.
  • Loading branch information
jskeet committed Dec 17, 2024
1 parent 42f24ac commit 474046e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public int Execute(Dictionary<string, string> options)
}
else
{
// Set environment variables used by scripts invoked by GenerateApisCommand.
Environment.SetEnvironmentVariable(GenerateApisCommand.GeneratorInputDirectoryEnvironmentVariable, rootLayout.GeneratorInput);
Environment.SetEnvironmentVariable(GenerateApisCommand.GeneratorOutputDirectoryEnvironmentVariable, rootLayout.GeneratorOutput);
Environment.SetEnvironmentVariable(GenerateApisCommand.GoogleApisDirectoryEnvironmentVariable, rootLayout.Googleapis);

if (apiPath is not null)
{
var catalog = ApiCatalog.Load(rootLayout);
Expand Down

0 comments on commit 474046e

Please sign in to comment.