提交 76081e5f 编写于 作者: D Daniel Hahler 提交者: Chris Wanstrath

Use `which` instead of `type -t` to detect a command.

Apart from "-t" not being supported by zsh's `type`, it does not appear
to work with bash, too.

Fixes: http://github.com/defunkt/hub/issues/#issue/47
上级 9d23c995
......@@ -5,7 +5,7 @@ require 'rake/testtask'
#
def command?(command)
`type -t #{command}`
`which #{command} 2>/dev/null`
$?.success?
end
......
......@@ -542,7 +542,7 @@ help
#
# Returns a Boolean.
def command?(name)
`type -t #{name}`
`which #{name} 2>/dev/null`
$?.success?
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册