Allow downloading the archive of the latest release
This commit is contained in:
parent
8e311847db
commit
acc1759434
2 changed files with 3 additions and 3 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue