Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
74641813
H
hub
项目概览
github
/
hub
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
74641813
编写于
1月 10, 2014
作者:
J
Jingwen Owen Ou
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request jingweno/gh:155 from jingweno/enable_bash_completion_test
Enable bash completion tests on Travis
上级
8c8bf332
68709fd6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
81 addition
and
14 deletion
+81
-14
.travis.yml
.travis.yml
+3
-3
commands/help.go
commands/help.go
+39
-11
script/ruby-test
script/ruby-test
+39
-0
未找到文件。
.travis.yml
浏览文件 @
74641813
before_install
:
-
sudo apt-get update -qq
-
sudo apt-get install -qq zsh git
-
rvm use 2.1.0 --install --binary --fuzzy
-
export BUNDLE_GEMFILE=$PWD/Gemfile
-
ruby --version
-
rvm --version
-
gem --version
-
sudo apt-get update -qq
-
sudo apt-get install -qq tmux zsh git
language
:
go
go
:
-
1.2
...
...
@@ -16,7 +16,7 @@ install:
script
:
-
script/build
-
script/test
-
bundle exec rake features
-
script/ruby-test
env
:
global
:
-
AMAZON_S3_BUCKET=gh-bundler-cache
...
...
commands/help.go
浏览文件 @
74641813
...
...
@@ -2,18 +2,34 @@ package commands
import
(
"fmt"
"github.com/jingweno/gh/utils"
"os"
"strings"
)
var
cmdHelp
=
&
Command
{
Usage
:
"help [command]"
,
Short
:
"Show help"
,
Long
:
`Shows usage for a command.`
,
Usage
:
"help [command]"
,
Short
:
"Show help"
,
Long
:
`Shows usage for a command.`
,
GitExtension
:
true
,
}
var
(
customCommands
=
[]
string
{
"alias"
,
"create"
,
"browse"
,
"compare"
,
"fork"
,
"pull-request"
,
"ci-status"
,
"release"
,
"issue"
,
"update"
,
}
)
func
init
()
{
cmdHelp
.
Run
=
runHelp
// break init loop
cmdHelp
.
Run
=
runHelp
CmdRunner
.
Use
(
cmdHelp
)
}
...
...
@@ -24,10 +40,6 @@ func runHelp(cmd *Command, args *Args) {
os
.
Exit
(
0
)
}
if
args
.
ParamsSize
()
>
1
{
utils
.
Check
(
fmt
.
Errorf
(
"too many arguments"
))
}
for
_
,
cmd
:=
range
CmdRunner
.
All
()
{
if
cmd
.
Name
()
==
args
.
FirstParam
()
{
cmd
.
PrintUsage
()
...
...
@@ -35,8 +47,24 @@ func runHelp(cmd *Command, args *Args) {
}
}
fmt
.
Fprintf
(
os
.
Stderr
,
"Unknown help topic: %q. Run 'git help'.
\n
"
,
args
.
FirstParam
())
os
.
Exit
(
2
)
if
parseHelpAllFlag
(
args
)
{
args
.
After
(
"echo"
,
"
\n
gh custom commands
\n
"
)
args
.
After
(
"echo"
,
" "
,
strings
.
Join
(
customCommands
,
" "
))
}
}
func
parseHelpAllFlag
(
args
*
Args
)
bool
{
i
:=
args
.
IndexOfParam
(
"-a"
)
if
i
!=
-
1
{
return
true
}
i
=
args
.
IndexOfParam
(
"--all"
)
if
i
!=
-
1
{
return
true
}
return
false
}
var
helpText
=
`usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
...
...
script/ruby-test
0 → 100755
浏览文件 @
74641813
#!/usr/bin/env bash
set
-e
STATUS
=
0
warnings
=
"
${
TMPDIR
:-
/tmp
}
/gh-warnings.
$$
"
run
()
{
# Save warnings on stderr to a separate file
RUBYOPT
=
"
$RUBYOPT
-w"
bundle
exec
"
$@
"
\
2>
>(
tee
>(
grep
'warning:'
>>
"
$warnings
"
)
|
grep
-v
'warning:'
)
||
STATUS
=
$?
}
check_warnings
()
{
# Display Ruby warnings from this project's source files. Abort if any were found.
num
=
"
$(
grep
-F
"
$PWD
"
"
$warnings
"
|
grep
-v
"
${
PWD
}
/vendor/bundle"
|
sort
|
uniq
-c
|
sort
-rn
|
tee
/dev/stderr |
wc
-l
)
"
rm
-f
"
$warnings
"
if
[
"
$num
"
-gt
0
]
;
then
echo
"FAILED: this test suite doesn't tolerate Ruby syntax warnings!"
>
&2
exit
1
fi
}
if
tmux
-V
;
then
if
[
-n
"
$CI
"
]
;
then
git
--version
bash
--version
|
head
-1
zsh
--version
echo
fi
profile
=
"all"
else
echo
"warning: skipping shell completion tests (install tmux to enable)"
>
&2
profile
=
"default"
fi
run cucumber
-p
"
$profile
"
-t
~@wip
check_warnings
exit
$STATUS
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录