mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix(release): create download directories, refuse duplicate asset names and empty notes (follow gh)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
5 files changed
+41
No files matched your search
@@ -217,10 +217,15 @@ $ tea release download v1.0.0 --archive zip`,
|
||||
}
|
||||
paths := make([]string, len(assets))
|
||||
skipped := make([]bool, len(assets))
|
||||
seen := map[string]services.ReleaseAsset{}
|
||||
for i, asset := range assets {
|
||||
if paths[i], skipped[i], err = flags.destination(asset.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
if first, dup := seen[paths[i]]; dup && paths[i] != "-" {
|
||||
return clierr.Wrap(clierr.Usage, fmt.Errorf("assets %d and %d are both named %s; download one at a time with --output", first.ID, asset.ID, asset.Name))
|
||||
}
|
||||
seen[paths[i]] = asset
|
||||
}
|
||||
for i, asset := range assets {
|
||||
if skipped[i] {
|
||||
|
||||
Reference in new issue
Block a user