2017-02-28 19:58:29 +01:00
|
|
|
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
|
2018-03-21 02:43:02 +01:00
|
|
|
b.ShowDiagnostics = opts.ShowDiagnostics
|
2017-02-28 19:58:29 +01:00
|
|
|
b.ContextOpts = opts.ContextOpts
|
|
|
|
b.OpInput = opts.Input
|
|
|
|
b.OpValidation = opts.Validation
|
2017-09-09 02:14:37 +02:00
|
|
|
b.RunningInAutomation = opts.RunningInAutomation
|
2017-02-28 19:58:29 +01:00
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|