mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 08:00:05 +01:00
move the extracted archive into place before exiting Install
This commit is contained in:
parent
41278d8ef4
commit
50eac0e70c
1 changed files with 7 additions and 0 deletions
|
|
@ -180,7 +180,14 @@ func (p *GitPackage) Install(ctx context.Context, name, dir, version string) (st
|
||||||
r, err := os.Open(archiveFilepath)
|
r, err := os.Open(archiveFilepath)
|
||||||
defer r.Close()
|
defer r.Close()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
// Extract the sub-directory (if any) from the archive
|
||||||
|
// If none specified, the entire archive is unpacked
|
||||||
err = gzipUntar(tmpDir, r, p.Source.Subdir)
|
err = gzipUntar(tmpDir, r, p.Source.Subdir)
|
||||||
|
|
||||||
|
// Move the extracted directory to its final destination
|
||||||
|
if err == nil {
|
||||||
|
err = os.Rename(path.Join(tmpDir, p.Source.Subdir), destPath)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue