aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/go-getter/get_hg.go
diff options
context:
space:
mode:
authorAlex Pilon <apilon@hashicorp.com>2019-02-22 18:24:37 -0500
committerAlex Pilon <apilon@hashicorp.com>2019-02-22 18:24:37 -0500
commit15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch)
tree255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/github.com/hashicorp/go-getter/get_hg.go
parent07971ca38143c5faf951d152fba370ddcbe26ad5 (diff)
downloadterraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz
terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst
terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
Diffstat (limited to 'vendor/github.com/hashicorp/go-getter/get_hg.go')
-rw-r--r--vendor/github.com/hashicorp/go-getter/get_hg.go10
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
3import ( 3import (
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.
66func (g *HgGetter) GetFile(dst string, u *url.URL) error { 66func (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.