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.
This commit is contained in:
Martin Atkins 2017-05-30 15:12:27 -07:00
parent 31d556894f
commit 5026e1d313
1 changed files with 18 additions and 1 deletions

View File

@ -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 != "" {