2023-05-02 10:33:06 -05:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2021-09-01 19:01:44 -05:00
|
|
|
package main
|
|
|
|
|
2023-09-20 06:35:35 -05:00
|
|
|
import "github.com/opentofu/opentofu/internal/command/workdir"
|
2021-09-01 19:01:44 -05:00
|
|
|
|
2023-10-13 09:59:01 -05:00
|
|
|
func workingDir(originalDir string, overrideDataDir string) *workdir.Dir {
|
2021-09-01 19:01:44 -05:00
|
|
|
ret := workdir.NewDir(".") // caller should already have used os.Chdir in "-chdir=..." mode
|
|
|
|
ret.OverrideOriginalWorkingDir(originalDir)
|
|
|
|
if overrideDataDir != "" {
|
|
|
|
ret.OverrideDataDir(overrideDataDir)
|
|
|
|
}
|
|
|
|
return ret
|
|
|
|
}
|