mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-11 16:15:33 -06:00
Make sure we expand the homedir
If a tilde is used in the path, this makes sure we expand it to a full path.
This commit is contained in:
parent
120599e68f
commit
7e388bb078
@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
"github.com/mitchellh/go-homedir"
|
||||
)
|
||||
|
||||
// Provider returns a terraform.ResourceProvider.
|
||||
@ -42,8 +43,13 @@ func Provider() terraform.ResourceProvider {
|
||||
}
|
||||
|
||||
func providerConfigure(d *schema.ResourceData) (interface{}, error) {
|
||||
settingsFile, err := homedir.Expand(d.Get("settings_file").(string))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
config := Config{
|
||||
SettingsFile: d.Get("settings_file").(string),
|
||||
SettingsFile: settingsFile,
|
||||
SubscriptionID: d.Get("subscription_id").(string),
|
||||
Certificate: []byte(d.Get("certificate").(string)),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user