Allow downloading the archive of the latest release

This commit is contained in:
Mislav Marohnić 2021-11-30 15:42:06 +01:00
parent 8e311847db
commit acc1759434
2 changed files with 3 additions and 3 deletions

View file

@ -68,8 +68,8 @@ func NewCmdDownload(f *cmdutil.Factory, runF func(*DownloadOptions) error) *cobr
opts.BaseRepo = f.BaseRepo
if len(args) == 0 {
if len(opts.FilePatterns) == 0 {
return cmdutil.FlagErrorf("the '--pattern' flag is required when downloading the latest release")
if len(opts.FilePatterns) == 0 && opts.ArchiveType == "" {
return cmdutil.FlagErrorf("`--pattern` or `--archive` is required when downloading the latest release")
}
} else {
opts.TagName = args[0]

View file

@ -96,7 +96,7 @@ func Test_NewCmdDownload(t *testing.T) {
name: "no arguments",
args: "",
isTTY: true,
wantErr: "the '--pattern' flag is required when downloading the latest release",
wantErr: "`--pattern` or `--archive` is required when downloading the latest release",
},
{
name: "simultaneous pattern and archive arguments",