diff options
author | appilon <apilon@hashicorp.com> | 2019-02-27 16:43:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-27 16:43:31 -0500 |
commit | 844b5a68d8af4791755b8f0ad293cc99f5959183 (patch) | |
tree | 255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/github.com/hashicorp/go-getter/get_hg.go | |
parent | 303b299eeb6b06e939e35905e4b34cb410dd9dc3 (diff) | |
parent | 15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (diff) | |
download | terraform-provider-statuscake-844b5a68d8af4791755b8f0ad293cc99f5959183.tar.gz terraform-provider-statuscake-844b5a68d8af4791755b8f0ad293cc99f5959183.tar.zst terraform-provider-statuscake-844b5a68d8af4791755b8f0ad293cc99f5959183.zip |
Merge pull request #27 from terraform-providers/go-modules-2019-02-22
[MODULES] Switch to Go Modules
Diffstat (limited to 'vendor/github.com/hashicorp/go-getter/get_hg.go')
-rw-r--r-- | vendor/github.com/hashicorp/go-getter/get_hg.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vendor/github.com/hashicorp/go-getter/get_hg.go b/vendor/github.com/hashicorp/go-getter/get_hg.go index 820bdd4..f386922 100644 --- a/vendor/github.com/hashicorp/go-getter/get_hg.go +++ b/vendor/github.com/hashicorp/go-getter/get_hg.go | |||
@@ -2,7 +2,6 @@ package getter | |||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | "io/ioutil" | ||
6 | "net/url" | 5 | "net/url" |
7 | "os" | 6 | "os" |
8 | "os/exec" | 7 | "os/exec" |
@@ -10,6 +9,7 @@ import ( | |||
10 | "runtime" | 9 | "runtime" |
11 | 10 | ||
12 | urlhelper "github.com/hashicorp/go-getter/helper/url" | 11 | urlhelper "github.com/hashicorp/go-getter/helper/url" |
12 | "github.com/hashicorp/go-safetemp" | ||
13 | ) | 13 | ) |
14 | 14 | ||
15 | // HgGetter is a Getter implementation that will download a module from | 15 | // HgGetter is a Getter implementation that will download a module from |
@@ -64,13 +64,13 @@ func (g *HgGetter) Get(dst string, u *url.URL) error { | |||
64 | // GetFile for Hg doesn't support updating at this time. It will download | 64 | // GetFile for Hg doesn't support updating at this time. It will download |
65 | // the file every time. | 65 | // the file every time. |
66 | func (g *HgGetter) GetFile(dst string, u *url.URL) error { | 66 | func (g *HgGetter) GetFile(dst string, u *url.URL) error { |
67 | td, err := ioutil.TempDir("", "getter-hg") | 67 | // Create a temporary directory to store the full source. This has to be |
68 | // a non-existent directory. | ||
69 | td, tdcloser, err := safetemp.Dir("", "getter") | ||
68 | if err != nil { | 70 | if err != nil { |
69 | return err | 71 | return err |
70 | } | 72 | } |
71 | if err := os.RemoveAll(td); err != nil { | 73 | defer tdcloser.Close() |
72 | return err | ||
73 | } | ||
74 | 74 | ||
75 | // Get the filename, and strip the filename from the URL so we can | 75 | // Get the filename, and strip the filename from the URL so we can |
76 | // just get the repository directly. | 76 | // just get the repository directly. |