From f70ba9cf805dc58d993e60fe2bb06d6c5e2f08cb Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 30 Sep 2022 10:17:46 +0900 Subject: [PATCH] Check for the availability of the command when detecting --- tool/lib/vcs.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index a08d40742a..d0301b92d8 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -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)