summaryrefslogtreecommitdiff
path: root/tasks/bin/bundle-platform
blob: aa8443e74c110a6fd07e6e93e3a76dc19b62c531 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env ruby
require_relative "bundler_patch"

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
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",
  Pathname.new(__FILE__).realpath)

require "rubygems"

load Gem.bin_path("bundler", "bundle", desired_version)