From 5026e1d31384caf9bab82f986f287a51cb5ecf9a Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 30 May 2017 15:12:27 -0700 Subject: [PATCH] backend/local: "environment_dir" renamed to "workspace_dir" As part of switching our terminology, we begin a deprecation cycle for "environment_dir" and advise users to switch to "workspace_dir" instead. --- backend/local/backend.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/backend/local/backend.go b/backend/local/backend.go index f5eb4ed61..cfae89ef6 100644 --- a/backend/local/backend.go +++ b/backend/local/backend.go @@ -291,11 +291,20 @@ func (b *Local) init() { Default: "", }, - "environment_dir": &schema.Schema{ + "workspace_dir": &schema.Schema{ Type: schema.TypeString, Optional: true, Default: "", }, + + "environment_dir": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Default: "", + ConflictsWith: []string{"workspace_dir"}, + + Deprecated: "workspace_dir should be used instead, with the same meaning", + }, }, ConfigureFunc: b.schemaConfigure, @@ -317,6 +326,14 @@ func (b *Local) schemaConfigure(ctx context.Context) error { b.StateOutPath = path } + if raw, ok := d.GetOk("workspace_dir"); ok { + path := raw.(string) + if path != "" { + b.StateEnvDir = path + } + } + + // Legacy name, which ConflictsWith workspace_dir if raw, ok := d.GetOk("environment_dir"); ok { path := raw.(string) if path != "" {