@@ -3,7 +3,7 @@ package main
33import (
44 "fmt"
55 "os"
6- "path"
6+ "path/filepath "
77
88 "code.gitea.io/sdk/gitea"
99)
@@ -86,12 +86,12 @@ func (rc *releaseClient) uploadFiles(releaseID int64, files []string) error {
8686files:
8787 for _ , file := range files {
8888 for _ , attachment := range attachments {
89- if attachment .Name == path .Base (file ) {
89+ if attachment .Name == filepath .Base (file ) {
9090 switch rc .FileExists {
9191 case "overwrite" :
9292 // do nothing
9393 case "fail" :
94- return fmt .Errorf ("Asset file %s already exists" , path .Base (file ))
94+ return fmt .Errorf ("Asset file %s already exists" , filepath .Base (file ))
9595 case "skip" :
9696 fmt .Printf ("Skipping pre-existing %s artifact\n " , attachment .Name )
9797 continue files
@@ -112,7 +112,7 @@ files:
112112 }
113113
114114 for _ , attachment := range attachments {
115- if attachment .Name == path .Base (file ) {
115+ if attachment .Name == filepath .Base (file ) {
116116 if _ , err := rc .Client .DeleteReleaseAttachment (rc .Owner , rc .Repo , releaseID , attachment .ID ); err != nil {
117117 return fmt .Errorf ("Failed to delete %s artifact: %s" , file , err )
118118 }
@@ -121,7 +121,7 @@ files:
121121 }
122122 }
123123
124- if _ , _ , err = rc .Client .CreateReleaseAttachment (rc .Owner , rc .Repo , releaseID , handle , path .Base (file )); err != nil {
124+ if _ , _ , err = rc .Client .CreateReleaseAttachment (rc .Owner , rc .Repo , releaseID , handle , filepath .Base (file )); err != nil {
125125 return fmt .Errorf ("Failed to upload %s artifact: %s" , file , err )
126126 }
127127
0 commit comments