mirror of
https://gitea.com/gitea/tea.git
synced 2026-09-10 07:26:33 -04:00
fix file closing
This commit is contained in:
parent
75b6116972
commit
35781832e5
|
|
@ -122,13 +122,14 @@ func runReleaseCreate(ctx *cli.Context) error {
|
|||
if file, err = os.Open(asset); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
filePath := filepath.Base(asset)
|
||||
|
||||
if _, err = login.Client().CreateReleaseAttachment(owner, repo, release.ID, file, filePath); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
file.Close()
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue