mirror of
https://github.com/goreleaser/nfpm
synced 2024-06-10 10:26:15 +02:00
chore: Cleanup temp files in RPM.Package() (#53)
RPM.Package() populates a temp directory with files to do its work. It should cleanup after itself.
This commit is contained in:
parent
21aa860653
commit
ce9ed27f16
|
@ -54,6 +54,7 @@ func (*RPM) Package(info nfpm.Info, w io.Writer) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer os.RemoveAll(temps.Root)
|
||||
if err = createTarGz(info, temps.Folder, temps.Source); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -84,6 +85,7 @@ func (*RPM) Package(info nfpm.Info, w io.Writer) error {
|
|||
if err != nil {
|
||||
return errors.Wrap(err, "failed open rpm file")
|
||||
}
|
||||
defer rpm.Close()
|
||||
_, err = io.Copy(w, rpm)
|
||||
return errors.Wrap(err, "failed to copy rpm file to writer")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue