close the temp file after cleaning
This commit is contained in:
parent
212f3a2d6d
commit
a3795ffb51
@ -44,9 +44,10 @@ func cleanCommand(cmd *cobra.Command, args []string) {
|
||||
file.Close()
|
||||
}
|
||||
|
||||
defer cleaned.Close()
|
||||
cleaned.Close()
|
||||
defer cleaned.Teardown()
|
||||
if err != nil {
|
||||
Panic(err, "Error cleaning asset")
|
||||
Panic(err, "Error cleaning asset.")
|
||||
}
|
||||
|
||||
tmpfile := cleaned.File.Name()
|
||||
|
@ -34,5 +34,9 @@ func Clean(reader io.Reader, size int64, cb gitmedia.CopyCallback) (*cleanedAsse
|
||||
}
|
||||
|
||||
func (a *cleanedAsset) Close() error {
|
||||
return a.File.Close()
|
||||
}
|
||||
|
||||
func (a *cleanedAsset) Teardown() error {
|
||||
return os.Remove(a.File.Name())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user