internal: Clean up package install temp file

The installFromHTTPURL function downloads a package to a temporary file,
then delegates to installFromLocalArchive to install it. We were
previously not deleting the temporary file afterwards. This commit fixes
that.
pull/25990/head
Alisdair McDiarmid 6 years ago
parent b1eec0fbcd
commit 915f53af23

@ -53,6 +53,7 @@ func installFromHTTPURL(ctx context.Context, meta getproviders.PackageMeta, targ
return nil, fmt.Errorf("failed to open temporary file to download from %s", url)
}
defer f.Close()
defer os.Remove(f.Name())
// We'll borrow go-getter's "cancelable copy" implementation here so that
// the download can potentially be interrupted partway through.

Loading…
Cancel
Save