mirror of https://github.com/grpc/grpc.git
The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)
https://grpc.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
591 B
31 lines
591 B
9 years ago
|
#!/usr/bin/env ruby
|
||
|
|
||
|
# Strip file on local folder instead of a Virtualbox shared folder
|
||
|
# to work around this bug: https://www.virtualbox.org/ticket/8463
|
||
|
|
||
|
require 'tempfile'
|
||
|
require 'fileutils'
|
||
|
|
||
|
strip = "#{File.basename($0)}.bin"
|
||
|
|
||
|
files = ARGV.reject{|f| f=~/^-/ }.map do |arg|
|
||
|
tmp = Tempfile.new 'strip'
|
||
|
tmp.close
|
||
|
FileUtils.cp arg, tmp.path
|
||
|
[tmp, arg]
|
||
|
end
|
||
|
|
||
|
options = ARGV.select{|f| f=~/^-/ } + files.map{|t,o| t.path }
|
||
|
|
||
|
unless system( strip, *options )
|
||
|
exit 127
|
||
|
end
|
||
|
code = $?.exitstatus
|
||
|
|
||
|
files.each do |tmp, orig|
|
||
|
FileUtils.rm orig
|
||
|
FileUtils.cp tmp.path, orig
|
||
|
end
|
||
|
|
||
|
exit code
|