ruby-changes:73801
From: Nobuyoshi <ko1@a...>
Date: Fri, 30 Sep 2022 12:49:30 +0900 (JST)
Subject: [ruby-changes:73801] f70ba9cf80 (master): Check for the availability of the command when detecting
https://git.ruby-lang.org/ruby.git/commit/?id=f70ba9cf80 From f70ba9cf805dc58d993e60fe2bb06d6c5e2f08cb Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 30 Sep 2022 10:17:46 +0900 Subject: 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 https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L69 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) -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/