opentofu/working_dir.go
2023-05-02 15:33:06 +00:00

16 lines
447 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package main
import "github.com/hashicorp/terraform/internal/command/workdir"
func WorkingDir(originalDir string, overrideDataDir string) *workdir.Dir {
ret := workdir.NewDir(".") // caller should already have used os.Chdir in "-chdir=..." mode
ret.OverrideOriginalWorkingDir(originalDir)
if overrideDataDir != "" {
ret.OverrideDataDir(overrideDataDir)
}
return ret
}