mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Check for the availability of the command when detecting
This commit is contained in:
parent
58b3a535cc
commit
f70ba9cf80
Notes:
git
2022-09-30 12:49:35 +09:00
1 changed files with 3 additions and 0 deletions
|
@ -69,6 +69,9 @@ class VCS
|
|||
begin
|
||||
@@dirs.each do |dir, klass, pred|
|
||||
if pred ? pred[curr, dir] : File.directory?(File.join(curr, dir))
|
||||
if klass.const_defined?(:COMMAND)
|
||||
IO.pread([{'LANG' => 'C', 'LC_ALL' => 'C'}, klass::COMMAND, "--version"]) rescue next
|
||||
end
|
||||
vcs = klass.new(curr)
|
||||
vcs.define_options(parser) if parser
|
||||
vcs.set_options(options)
|
||||
|
|
Loading…
Reference in a new issue