From eabd8b1cc5a4c5361843a78b94a800b4cf91d389 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 25 Sep 2014 22:39:31 -0700 Subject: [PATCH] Fix CWD plugin loading. --- CHANGELOG.md | 3 ++- config.go | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58df070ff..f82ba8bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.2.3 (unreleased) +## 0.3.0 (unreleased) IMPROVEMENTS: @@ -10,6 +10,7 @@ BUG FIXES: * core: Providers are validated even without a `provider` block. [GH-284] * core: In the case of error, walk all non-dependent trees. + * core: Plugin loading from CWD works properly. * providers/aws: autoscaling_group can be launched into a vpc [GH-259] ## 0.2.2 (September 9, 2014) diff --git a/config.go b/config.go index d6515ce23..1b2e7ced3 100644 --- a/config.go +++ b/config.go @@ -114,6 +114,14 @@ func (c1 *Config) Merge(c2 *Config) *Config { func (c *Config) discover(path string) error { var err error + + if !filepath.IsAbs(path) { + path, err = filepath.Abs(path) + if err != nil { + return err + } + } + err = c.discoverSingle( filepath.Join(path, "terraform-provider-*"), &c.Providers) if err != nil {