diff options
-rwxr-xr-x | tool/pure_parser.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tool/pure_parser.rb b/tool/pure_parser.rb index 4d5e86e543..9ab663830e 100755 --- a/tool/pure_parser.rb +++ b/tool/pure_parser.rb @@ -4,7 +4,12 @@ BEGIN { colorize = Colorize.new file = ARGV.shift - unless /\Abison .* (\d+)\.\d+/ =~ IO.popen(ARGV+%w[--version], &:read) + begin + version = IO.popen(ARGV+%w[--version], &:read) + rescue Errno::ENOENT + abort "Failed to run `#{colorize.fail ARGV.join(' ')}'; You may have to install it." + end + unless /\Abison .* (\d+)\.\d+/ =~ version puts colorize.fail("not bison") exit end |