From 998093893992b75ff9368bf4f82f4a856e026091 Mon Sep 17 00:00:00 2001 From: troyready Date: Mon, 5 Jun 2023 17:46:33 -0700 Subject: [PATCH] ensure block env vars are included when launching tf-shell --- CHANGELOG.md | 2 ++ src/index.ts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 536e9f7..30b026f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- tf-shell: general environment variables weren't included in subshell ## [0.10.1] - 2023-05-07 ### Fixed diff --git a/src/index.ts b/src/index.ts index 1e5ab1c..e46f7e5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -128,6 +128,11 @@ class IHLP { process.chdir(block.path); const tfSetupRes = await runner.tfSetup(); const tfShellEnvVars = runner.addTfVarsToEnv(block.options.variables); + if (block.envVars) { + for (const key of Object.keys(block.envVars)) { + tfShellEnvVars[key] = block.envVars[key]; + } + } if (tfSetupRes.tfVersionDir) { tfShellEnvVars.PATH = tfSetupRes.tfVersionDir + ":" + tfShellEnvVars.PATH;