From 026da86b2c410b3e80cb2b3a141ed4b2f27eacbb Mon Sep 17 00:00:00 2001
From: Matt Calhoun <matt@mattcalhoun.com>
Date: Wed, 29 Jan 2025 13:48:05 -0500
Subject: [PATCH] set COMPONENT_HELPER_STATE_DIR env var for atmos commands

---
 pkg/atmos/component-helper/atmos_options.go | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pkg/atmos/component-helper/atmos_options.go b/pkg/atmos/component-helper/atmos_options.go
index e98b5e9..85c98e8 100644
--- a/pkg/atmos/component-helper/atmos_options.go
+++ b/pkg/atmos/component-helper/atmos_options.go
@@ -28,8 +28,11 @@ func getAtmosOptions(t *testing.T, config *c.Config, componentName string, stack
 		BackendConfig: map[string]interface{}{
 			"workspace_key_prefix": strings.Join([]string{config.RandomIdentifier, stackName}, "-"),
 		},
-		Vars:    mergedVars,
-		EnvVars: map[string]string{"ATMOS_BASE_PATH": config.TempDir},
+		Vars: mergedVars,
+		EnvVars: map[string]string{
+			"ATMOS_BASE_PATH":             config.TempDir,
+			"ATMOS_TEST_HELPER_STATE_DIR": config.TempDir,
+		},
 	}
 	return atmosOptions
 }