X Tutup
Skip to content

Commit acc1759

Browse files
committed
Allow downloading the archive of the latest release
1 parent 8e31184 commit acc1759

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/cmd/release/download/download.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ func NewCmdDownload(f *cmdutil.Factory, runF func(*DownloadOptions) error) *cobr
6868
opts.BaseRepo = f.BaseRepo
6969

7070
if len(args) == 0 {
71-
if len(opts.FilePatterns) == 0 {
72-
return cmdutil.FlagErrorf("the '--pattern' flag is required when downloading the latest release")
71+
if len(opts.FilePatterns) == 0 && opts.ArchiveType == "" {
72+
return cmdutil.FlagErrorf("`--pattern` or `--archive` is required when downloading the latest release")
7373
}
7474
} else {
7575
opts.TagName = args[0]

pkg/cmd/release/download/download_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func Test_NewCmdDownload(t *testing.T) {
9696
name: "no arguments",
9797
args: "",
9898
isTTY: true,
99-
wantErr: "the '--pattern' flag is required when downloading the latest release",
99+
wantErr: "`--pattern` or `--archive` is required when downloading the latest release",
100100
},
101101
{
102102
name: "simultaneous pattern and archive arguments",

0 commit comments

Comments
 (0)
X Tutup