refactor: rename variable for clarity
This commit is contained in:
6
test.ts
6
test.ts
@@ -198,13 +198,13 @@ export const runTerraformApply = async <TVars extends TerraformVariables>(
|
|||||||
): Promise<TerraformState> => {
|
): Promise<TerraformState> => {
|
||||||
const stateFile = `${dir}/${crypto.randomUUID()}.tfstate`;
|
const stateFile = `${dir}/${crypto.randomUUID()}.tfstate`;
|
||||||
|
|
||||||
const combinedEnv: Record<string, string | undefined> = {
|
const childEnv: Record<string, string | undefined> = {
|
||||||
...process.env,
|
...process.env,
|
||||||
...(customEnv ?? {}),
|
...(customEnv ?? {}),
|
||||||
};
|
};
|
||||||
for (const [key, value] of Object.entries(vars) as [string, JsonValue][]) {
|
for (const [key, value] of Object.entries(vars) as [string, JsonValue][]) {
|
||||||
if (value !== null) {
|
if (value !== null) {
|
||||||
combinedEnv[`TF_VAR_${key}`] = String(value);
|
childEnv[`TF_VAR_${key}`] = String(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ export const runTerraformApply = async <TVars extends TerraformVariables>(
|
|||||||
],
|
],
|
||||||
{
|
{
|
||||||
cwd: dir,
|
cwd: dir,
|
||||||
env: combinedEnv,
|
env: childEnv,
|
||||||
stderr: "pipe",
|
stderr: "pipe",
|
||||||
stdout: "pipe",
|
stdout: "pipe",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user