@@ -3,7 +3,7 @@ package main
3
3
import (
4
4
"fmt"
5
5
"os"
6
- "path"
6
+ "path/filepath "
7
7
8
8
"code.gitea.io/sdk/gitea"
9
9
)
@@ -86,12 +86,12 @@ func (rc *releaseClient) uploadFiles(releaseID int64, files []string) error {
86
86
files:
87
87
for _ , file := range files {
88
88
for _ , attachment := range attachments {
89
- if attachment .Name == path .Base (file ) {
89
+ if attachment .Name == filepath .Base (file ) {
90
90
switch rc .FileExists {
91
91
case "overwrite" :
92
92
// do nothing
93
93
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 ))
95
95
case "skip" :
96
96
fmt .Printf ("Skipping pre-existing %s artifact\n " , attachment .Name )
97
97
continue files
@@ -112,7 +112,7 @@ files:
112
112
}
113
113
114
114
for _ , attachment := range attachments {
115
- if attachment .Name == path .Base (file ) {
115
+ if attachment .Name == filepath .Base (file ) {
116
116
if _ , err := rc .Client .DeleteReleaseAttachment (rc .Owner , rc .Repo , releaseID , attachment .ID ); err != nil {
117
117
return fmt .Errorf ("Failed to delete %s artifact: %s" , file , err )
118
118
}
@@ -121,7 +121,7 @@ files:
121
121
}
122
122
}
123
123
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 {
125
125
return fmt .Errorf ("Failed to upload %s artifact: %s" , file , err )
126
126
}
127
127
0 commit comments