Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
cc1757ca
H
hub
项目概览
github
/
hub
10 个月 前同步成功
通知
3
Star
22523
Fork
2406
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
cc1757ca
编写于
6月 07, 2018
作者:
M
Mislav Marohnić
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve scenario when `<TAG>` was not given to `hub release`
上级
c3c34ef2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
5 deletion
+26
-5
commands/release.go
commands/release.go
+6
-5
features/release.feature
features/release.feature
+20
-0
未找到文件。
commands/release.go
浏览文件 @
cc1757ca
...
...
@@ -21,6 +21,7 @@ release [--include-drafts] [--exclude-prereleases] [-L <LIMIT>]
release show <TAG>
release create [-dpoc] [-a <FILE>] [-m <MESSAGE>|-F <FILE>] [-t <TARGET>] <TAG>
release edit [<options>] <TAG>
release download <TAG>
release delete <TAG>
`
,
Long
:
`Manage GitHub releases.
...
...
@@ -303,7 +304,7 @@ func formatRelease(release github.Release, format string, colorize bool) string
func
showRelease
(
cmd
*
Command
,
args
*
Args
)
{
tagName
:=
cmd
.
Arg
(
0
)
if
tagName
==
""
{
utils
.
Check
(
fmt
.
Errorf
(
"Missing argument TAG"
))
utils
.
Check
(
fmt
.
Errorf
(
cmdRelease
.
Synopsis
()
))
}
localRepo
,
err
:=
github
.
LocalRepo
()
...
...
@@ -344,7 +345,7 @@ func showRelease(cmd *Command, args *Args) {
func
downloadRelease
(
cmd
*
Command
,
args
*
Args
)
{
tagName
:=
cmd
.
Arg
(
0
)
if
tagName
==
""
{
utils
.
Check
(
fmt
.
Errorf
(
"Missing argument TAG"
))
utils
.
Check
(
fmt
.
Errorf
(
cmdRelease
.
Synopsis
()
))
}
localRepo
,
err
:=
github
.
LocalRepo
()
...
...
@@ -390,7 +391,7 @@ func downloadReleaseAsset(asset github.ReleaseAsset, gh *github.Client) (err err
func
createRelease
(
cmd
*
Command
,
args
*
Args
)
{
tagName
:=
cmd
.
Arg
(
0
)
if
tagName
==
""
{
utils
.
Check
(
fmt
.
Errorf
(
"Missing argument TAG"
))
utils
.
Check
(
fmt
.
Errorf
(
cmdRelease
.
Synopsis
()
))
return
}
...
...
@@ -459,7 +460,7 @@ text is the title and the rest is the description.`, tagName, project))
func
editRelease
(
cmd
*
Command
,
args
*
Args
)
{
tagName
:=
cmd
.
Arg
(
0
)
if
tagName
==
""
{
utils
.
Check
(
fmt
.
Errorf
(
"Missing argument TAG"
))
utils
.
Check
(
fmt
.
Errorf
(
cmdRelease
.
Synopsis
()
))
return
}
...
...
@@ -542,7 +543,7 @@ text is the title and the rest is the description.`, tagName, project))
func
deleteRelease
(
cmd
*
Command
,
args
*
Args
)
{
tagName
:=
cmd
.
Arg
(
0
)
if
tagName
==
""
{
utils
.
Check
(
fmt
.
Errorf
(
"Missing argument TAG"
))
utils
.
Check
(
fmt
.
Errorf
(
cmdRelease
.
Synopsis
()
))
return
}
...
...
features/release.feature
浏览文件 @
cc1757ca
...
...
@@ -320,6 +320,11 @@ MARKDOWN
https://github.com/mislav/will_paginate/archive/v1.2.0.tar.gz\n
"""
Scenario
:
Show release no tag
When
I run `hub release show`
Then
the exit status should be 1
Then
the stderr should contain
"hub release show"
Scenario
:
Create a release
Given the GitHub API server
:
"""
...
...
@@ -394,6 +399,11 @@ MARKDOWN
Then
the output should contain exactly
""
And "open https
:
//github.com/mislav/will_paginate/releases/v1.2.0"
should
be
run
Scenario
:
Create release no tag
When
I run `hub release create -m hello`
Then
the exit status should be 1
Then
the stderr should contain
"hub release create"
Scenario
:
Edit existing release
Given the GitHub API server
:
"""
...
...
@@ -469,6 +479,11 @@ MARKDOWN
Attaching release asset `hello-1.2.0.tar.gz'...\n
"""
Scenario
:
Edit release no tag
When
I run `hub release edit -m hello`
Then
the exit status should be 1
Then
the stderr should contain
"hub release edit"
Scenario
:
Download a release asset.
Given the GitHub API server
:
"""
...
...
@@ -512,6 +527,11 @@ MARKDOWN
ASSET_TARBALL
"""
Scenario
:
Download release no tag
When
I run `hub release download`
Then
the exit status should be 1
Then
the stderr should contain
"hub release download"
Scenario
:
Delete a release
Given the GitHub API server
:
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录