Skip to content

Commit 4d04641

Browse files
committed
Use target directory for tmpdir
1 parent 35bd13c commit 4d04641

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

cmd/gget/command.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ func (c *Command) Execute(_ []string) error {
179179
} else {
180180
steps = append(
181181
steps,
182-
&downloader.DownloadTmpfileInstaller{},
182+
&downloader.DownloadTmpfileInstaller{
183+
Tmpdir: filepath.Dir(localPath),
184+
},
183185
)
184186
}
185187

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASu
1717
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
1818
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
1919
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
20+
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
2021
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
2122
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
2223
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=

pkg/downloader/installer_tmpfile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (dpi *DownloadTmpfileInstaller) GetProgressParams() (int64, decor.Decorator
2424
}
2525

2626
func (dpi *DownloadTmpfileInstaller) GetWriter() (io.Writer, error) {
27-
p, err := ioutil.TempFile(dpi.Tmpdir, "gget-tmpfile-*")
27+
p, err := ioutil.TempFile(dpi.Tmpdir, ".gget-*")
2828
if err != nil {
2929
return nil, errors.Wrap(err, "creating tempfile")
3030
}

0 commit comments

Comments
 (0)