mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-15 19:22:46 -06:00
5782357c28
The new config loader requires some steps to happen in a different order, particularly in regard to knowing the schema in order to decode the configuration. Here we lean directly on the configschema package, rather than on helper/schema.Backend as before, because it's generally sufficient for our needs here and this prepares us for the helper/schema package later moving out into its own repository to seed a "plugin SDK".
26 lines
603 B
Go
26 lines
603 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.ShowDiagnostics = opts.ShowDiagnostics
|
|
b.ContextOpts = opts.ContextOpts
|
|
b.OpInput = opts.Input
|
|
b.OpValidation = opts.Validation
|
|
b.RunningInAutomation = opts.RunningInAutomation
|
|
|
|
// 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
|
|
}
|