提交 3e69b8ec 编写于 作者: M Mislav Marohnić

Merge branch 'unknown-shell'

......@@ -36,7 +36,11 @@ func alias(command *Command, args *Args) {
}
if shell == "" {
utils.Check(fmt.Errorf("Unknown shell"))
cmd := "hub alias <shell>"
if flagAliasScript {
cmd = "hub alias -s <shell>"
}
utils.Check(fmt.Errorf("Error: couldn't detect shell type. Please specify your shell with `%s`", cmd))
}
shells := []string{"bash", "zsh", "sh", "ksh", "csh", "tcsh", "fish"}
......
......@@ -99,3 +99,21 @@ Feature: hub alias
supported shells: bash zsh sh ksh csh tcsh fish\n
"""
And the exit status should be 1
Scenario: unknown shell
Given $SHELL is ""
When I run `hub alias`
Then the output should contain exactly:
"""
Error: couldn't detect shell type. Please specify your shell with `hub alias <shell>`\n
"""
And the exit status should be 1
Scenario: unknown shell output
Given $SHELL is ""
When I run `hub alias -s`
Then the output should contain exactly:
"""
Error: couldn't detect shell type. Please specify your shell with `hub alias -s <shell>`\n
"""
And the exit status should be 1
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册