Skip to content

Commit

Permalink
Ruby Tools: automatically include plugin argument in protoc command
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Jul 27, 2016
1 parent b51eeb5 commit 0b316b0
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/ruby/tools/bin/grpc_tools_ruby_protoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@

require_relative '../os_check'

protoc_name = 'protoc' + RbConfig::CONFIG['EXEEXT']
ext = RbConfig::CONFIG['EXEEXT']

protoc_path = File.join(File.dirname(__FILE__),
RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name,
protoc_name)
protoc_name = 'protoc' + ext

exec([ protoc_path, protoc_path ], *ARGV)
plugin_name = 'grpc_ruby_plugin' + ext

protoc_dir = File.join(File.dirname(__FILE__),
RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name)

protoc_path = File.join(protoc_dir, protoc_name)

plugin_path = File.join(protoc_dir, plugin_name)

exec([ protoc_path, protoc_path ], "--plugin=protoc-gen-grpc=#{plugin_path}", *ARGV)

0 comments on commit 0b316b0

Please sign in to comment.