mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provisioner/file: expand ~ in source
closes #1559 tested manually, since a unit test would be sort of annoying to write. :)
This commit is contained in:
parent
a6325ad18c
commit
3f66e480cc
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/hashicorp/terraform/helper/config"
|
"github.com/hashicorp/terraform/helper/config"
|
||||||
helper "github.com/hashicorp/terraform/helper/ssh"
|
helper "github.com/hashicorp/terraform/helper/ssh"
|
||||||
"github.com/hashicorp/terraform/terraform"
|
"github.com/hashicorp/terraform/terraform"
|
||||||
|
"github.com/mitchellh/go-homedir"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ResourceProvisioner struct{}
|
type ResourceProvisioner struct{}
|
||||||
@ -35,6 +36,11 @@ func (p *ResourceProvisioner) Apply(
|
|||||||
return fmt.Errorf("Unsupported 'source' type! Must be string.")
|
return fmt.Errorf("Unsupported 'source' type! Must be string.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
src, err = homedir.Expand(src)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
dRaw := c.Config["destination"]
|
dRaw := c.Config["destination"]
|
||||||
dst, ok := dRaw.(string)
|
dst, ok := dRaw.(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user