This commit is contained in:
諏訪原慶斗 2026-02-17 08:34:53 -08:00 committed by GitHub
commit 7eeb6b1717
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,6 +5,11 @@ package main
import "github.com/hashicorp/terraform/internal/command/workdir"
// WorkingDir configures the working directory environment for Terraform.
//
// originalDir is the absolute path where the process started (before any -chdir).
// overrideDataDir is an optional path to override the default data directory
// (typically .terraform), usually set via TF_DATA_DIR.
func WorkingDir(originalDir string, overrideDataDir string) *workdir.Dir {
ret := workdir.NewDir(".") // caller should already have used os.Chdir in "-chdir=..." mode
ret.OverrideOriginalWorkingDir(originalDir)