main: use cliconfig.ConfigDir instead of just ConfigDir

main.ConfigDir is just a wrapper around cliconfig.ConfigDir to allow us to
gradually clean up the old calls here, but since this is new code we might
as well do it right from the start.
This commit is contained in:
Martin Atkins 2019-09-09 11:12:57 -07:00
parent 131656a237
commit 67d6f58f31
1 changed files with 4 additions and 2 deletions

View File

@ -4,13 +4,15 @@ import (
"os" "os"
"os/signal" "os/signal"
"github.com/mitchellh/cli"
"github.com/hashicorp/terraform/command" "github.com/hashicorp/terraform/command"
"github.com/hashicorp/terraform/command/cliconfig"
"github.com/hashicorp/terraform/command/webbrowser" "github.com/hashicorp/terraform/command/webbrowser"
pluginDiscovery "github.com/hashicorp/terraform/plugin/discovery" pluginDiscovery "github.com/hashicorp/terraform/plugin/discovery"
"github.com/hashicorp/terraform/svchost" "github.com/hashicorp/terraform/svchost"
"github.com/hashicorp/terraform/svchost/auth" "github.com/hashicorp/terraform/svchost/auth"
"github.com/hashicorp/terraform/svchost/disco" "github.com/hashicorp/terraform/svchost/disco"
"github.com/mitchellh/cli"
) )
// runningInAutomationEnvName gives the name of an environment variable that // runningInAutomationEnvName gives the name of an environment variable that
@ -51,7 +53,7 @@ func initCommands(config *Config, services *disco.Disco) {
services.ForceHostServices(host, hostConfig.Services) services.ForceHostServices(host, hostConfig.Services)
} }
configDir, err := ConfigDir() configDir, err := cliconfig.ConfigDir()
if err != nil { if err != nil {
configDir = "" // No config dir available (e.g. looking up a home directory failed) configDir = "" // No config dir available (e.g. looking up a home directory failed)
} }