mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-02 12:17:39 -06:00
3cedfa00f4
I made this interface way back with the original backend work and I guess I forgot to hook it up! This is becoming an issue as I'm working on our 2nd enhanced backend that requires this information and I realized it was hardcoded before. This propertly uses the CLIInit interface allowing any backend to gain access to this data.
24 lines
511 B
Go
24 lines
511 B
Go
package local
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/backend"
|
|
)
|
|
|
|
// backend.CLI impl.
|
|
func (b *Local) CLIInit(opts *backend.CLIOpts) error {
|
|
b.CLI = opts.CLI
|
|
b.CLIColor = opts.CLIColor
|
|
b.ContextOpts = opts.ContextOpts
|
|
b.OpInput = opts.Input
|
|
b.OpValidation = opts.Validation
|
|
|
|
// Only configure state paths if we didn't do so via the configure func.
|
|
if b.StatePath == "" {
|
|
b.StatePath = opts.StatePath
|
|
b.StateOutPath = opts.StateOutPath
|
|
b.StateBackupPath = opts.StateBackupPath
|
|
}
|
|
|
|
return nil
|
|
}
|