]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/hashicorp/terraform/config/module/get.go
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / config / module / get.go
index 96b4a63c3d976c155ea689a3fb45250c4bc0cf91..5073d0d271569538887efb0a05e580f28038c338 100644 (file)
@@ -3,6 +3,7 @@ package module
 import (
        "io/ioutil"
        "os"
+       "path/filepath"
 
        "github.com/hashicorp/go-getter"
 )
@@ -37,13 +38,10 @@ func GetCopy(dst, src string) error {
        if err != nil {
                return err
        }
-       // FIXME: This isn't completely safe. Creating and removing our temp path
-       //        exposes where to race to inject files.
-       if err := os.RemoveAll(tmpDir); err != nil {
-               return err
-       }
        defer os.RemoveAll(tmpDir)
 
+       tmpDir = filepath.Join(tmpDir, "module")
+
        // Get to that temporary dir
        if err := getter.Get(tmpDir, src); err != nil {
                return err
@@ -57,15 +55,3 @@ func GetCopy(dst, src string) error {
        // Copy to the final location
        return copyDir(dst, tmpDir)
 }
-
-func getStorage(s getter.Storage, key string, src string, mode GetMode) (string, bool, error) {
-       // Get the module with the level specified if we were told to.
-       if mode > GetModeNone {
-               if err := s.Get(key, src, mode == GetModeUpdate); err != nil {
-                       return "", false, err
-               }
-       }
-
-       // Get the directory where the module is.
-       return s.Dir(key)
-}