add backend cli options after configuration

The cli should override the config
This commit is contained in:
James Bardin 2018-10-16 20:47:23 -04:00
parent 86e6481cc6
commit 0a0eece15c
1 changed files with 8 additions and 2 deletions

View File

@ -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
}