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:
Paul Hinze 2015-04-16 18:53:04 -05:00
parent a6325ad18c
commit 3f66e480cc

View File

@ -9,6 +9,7 @@ import (
"github.com/hashicorp/terraform/helper/config"
helper "github.com/hashicorp/terraform/helper/ssh"
"github.com/hashicorp/terraform/terraform"
"github.com/mitchellh/go-homedir"
)
type ResourceProvisioner struct{}
@ -35,6 +36,11 @@ func (p *ResourceProvisioner) Apply(
return fmt.Errorf("Unsupported 'source' type! Must be string.")
}
src, err = homedir.Expand(src)
if err != nil {
return err
}
dRaw := c.Config["destination"]
dst, ok := dRaw.(string)
if !ok {