summaryrefslogtreecommitdiff
path: root/chef-bin/Rakefile
blob: 7fe4f1e9d426c99819ce58af71d4340e7065f4a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# we need to force the install in order to overwrite the binstubs from
# old chef gems.

require "bundler/gem_helper"

Bundler::GemHelper.install_tasks

# this is necessary to use to overwrite any chef-14 or earlier era gem which has the bin files in
# the chef gem itself
desc "force install the chef-bin gem"
task "install:force" do
  sh "gem build -V chef-bin.gemspec"
  built_gem_path = Dir["chef-bin-*.gem"].max_by { |f| File.mtime(f) }
  FileUtils.mkdir_p("pkg") unless Dir.exist?("pkg")
  FileUtils.mv(built_gem_path, "pkg")
  sh "gem install -f pkg/#{built_gem_path}"
end