]> git.pld-linux.org Git - packages/vagrant.git/blame - vagrant.sh
lib/pre-rubygems.rb is gone
[packages/vagrant.git] / vagrant.sh
CommitLineData
2fe4e4ef
ER
1#!/bin/sh
2#
3# This is a wrapper to properly execute Vagrant so that it sees system gems and
4# merges with it's own gems.
5#
6# This sets up proper environmental variables so that everything loads and
7# compiles to proper directories.
8
9# Set the path to the Ruby executable
10RUBY_EXECUTABLE="/usr/bin/ruby"
11
12GEM_PATH=$($RUBY_EXECUTABLE -r rubygems -e 'puts Gem.respond_to?(:default_dirs) ? Gem.default_dirs[:system][:gem_dir] : Gem.path.first')
13export GEM_PATH
14
15# Export gem paths so it can find vagrant own gem
16export GEM_HOME="${GEM_PATH}"
17
2fe4e4ef
ER
18# Unset any RUBYOPT and RUBYLIB, we don't want these bleeding into our
19# runtime.
20unset RUBYOPT
21unset RUBYLIB
22
23# Find the Vagrant executable
24for needle in "${GEM_PATH}/gems/vagrant-"*; do
6c09bd0b 25 if [ -f "${needle}/lib/vagrant/version.rb" ]; then
2fe4e4ef
ER
26 VAGRANT_GEM_PATH="${needle}"
27 fi
28done
29
30VAGRANT_EXECUTABLE="${VAGRANT_GEM_PATH}/bin/vagrant"
2fe4e4ef
ER
31
32# Call the actual Vagrant bin with our arguments
6c09bd0b 33exec "$RUBY_EXECUTABLE" -r rubygems "$VAGRANT_EXECUTABLE" "$@"
This page took 0.060151 seconds and 4 git commands to generate.