opentofu/backend/local/cli.go
Mitchell Hashimoto 3cedfa00f4
command: use backend.CLIIinit
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.
2017-02-28 10:58:29 -08:00

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
}