mirror of
https://github.com/thegeeklab/wp-gitea-release.git
synced 2024-11-13 22:50:42 +00:00
using StringSlice instead of []string for Files
This commit is contained in:
parent
fcfb446e4c
commit
d4f663cf8f
4
DOCS.md
4
DOCS.md
@ -13,8 +13,7 @@ Sample configuration:
|
|||||||
publish:
|
publish:
|
||||||
github_release:
|
github_release:
|
||||||
api_key: my_github_api_key
|
api_key: my_github_api_key
|
||||||
files:
|
files: dist/*
|
||||||
- dist/*
|
|
||||||
checksum: sha1
|
checksum: sha1
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -26,6 +25,7 @@ publish:
|
|||||||
api_key: my_github_api_key
|
api_key: my_github_api_key
|
||||||
files:
|
files:
|
||||||
- dist/*
|
- dist/*
|
||||||
|
- bin/binary.exe
|
||||||
checksum:
|
checksum:
|
||||||
- md5
|
- md5
|
||||||
- sha1
|
- sha1
|
||||||
|
2
main.go
2
main.go
@ -60,7 +60,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var files []string
|
var files []string
|
||||||
for _, glob := range vargs.Files {
|
for _, glob := range vargs.Files.Slice() {
|
||||||
globed, err := filepath.Glob(glob)
|
globed, err := filepath.Glob(glob)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Failed to glob %s\n", glob)
|
fmt.Printf("Failed to glob %s\n", glob)
|
||||||
|
2
types.go
2
types.go
@ -7,6 +7,6 @@ type Params struct {
|
|||||||
BaseURL string `json:"base_url"`
|
BaseURL string `json:"base_url"`
|
||||||
UploadURL string `json:"upload_url"`
|
UploadURL string `json:"upload_url"`
|
||||||
APIKey string `json:"api_key"`
|
APIKey string `json:"api_key"`
|
||||||
Files []string `json:"files"`
|
Files drone.StringSlice `json:"files"`
|
||||||
Checksum drone.StringSlice `json:"checksum"`
|
Checksum drone.StringSlice `json:"checksum"`
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user