summaryrefslogtreecommitdiff
path: root/tasks/bin
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2016-05-25 16:43:58 -0700
committerMatt Wrock <matt@mattwrock.com>2016-05-25 16:43:58 -0700
commit5d37fc2168b30d8ad51cc6b1d127528768bde3de (patch)
tree7207230ce7cbc0e3adb736797bd2cd3ec202df47 /tasks/bin
parent7e3a0aa1ed3559dd599b95cfb90599e2aeedbe6f (diff)
downloadchef-5d37fc2168b30d8ad51cc6b1d127528768bde3de.tar.gz
fix bundle locking on bundler 1.12 and enforce version we wantbun_1_11
Diffstat (limited to 'tasks/bin')
-rwxr-xr-xtasks/bin/bundle-platform8
1 files changed, 6 insertions, 2 deletions
diff --git a/tasks/bin/bundle-platform b/tasks/bin/bundle-platform
index 7c77393cb1..10d9bb2b3d 100755
--- a/tasks/bin/bundle-platform
+++ b/tasks/bin/bundle-platform
@@ -1,10 +1,14 @@
#!/usr/bin/env ruby
platforms = ARGV.shift
+platforms = platforms.split(" ").map { |p| Gem::Platform.new(p) }
+Gem::Platform.instance_eval { @local = platforms.last }
old_platforms = Gem.platforms
-Gem.platforms = platforms.split(" ").map { |p| Gem::Platform.new(p) }
+Gem.platforms = platforms
puts "bundle-platform set Gem.platforms to #{Gem.platforms.map { |p| p.to_s }} (was #{old_platforms.map { |p| p.to_s } })"
+desired_version = ARGV.shift.delete("_", "")
+
# The rest of this is a normal bundler binstub
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile",
@@ -12,4 +16,4 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile",
require "rubygems"
-load Gem.bin_path("bundler", "bundle")
+load Gem.bin_path("bundler", "bundle", desired_version)