add backend cli options after configuration

The cli should override the config
pull/19100/head
James Bardin 8 years ago
parent 86e6481cc6
commit 0a0eece15c

@ -14,10 +14,16 @@ func (b *Local) CLIInit(opts *backend.CLIOpts) error {
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 == "" {
// configure any new cli options
if opts.StatePath != "" {
b.StatePath = opts.StatePath
}
if opts.StateOutPath != "" {
b.StateOutPath = opts.StateOutPath
}
if opts.StateBackupPath != "" {
b.StateBackupPath = opts.StateBackupPath
}

Loading…
Cancel
Save