brew/Library/Homebrew/dev-cmd/vendor-gems.rb
Mike McQuaid 141db03193
vendor-gems: fix output location, also run pristine.
This means the output is consistent and ensures that we get rid of any local cruft when installing.
2019-03-05 08:34:33 +00:00

44 lines
940 B
Ruby

require "formula"
require "cli_parser"
module Homebrew
module_function
def vendor_gems_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`vendor-gems`
Install and commit Homebrew's vendored gems.
EOS
switch :debug
end
end
def vendor_gems
vendor_gems_args.parse
Homebrew.install_bundler!
ohai "cd #{HOMEBREW_LIBRARY_PATH}"
HOMEBREW_LIBRARY_PATH.cd do
ohai "bundle pristine"
safe_system "bundle", "pristine"
ohai "bundle install --standalone"
safe_system "bundle", "install", "--standalone"
ohai "git add vendor/bundle"
system "git", "add", "vendor/bundle"
if Formula["gpg"].installed?
ENV["PATH"] = PATH.new(ENV["PATH"])
.prepend(Formula["gpg"].opt_bin)
end
ohai "git commit"
system "git", "commit", "--message", "brew vendor-gems: commit updates."
end
end
end