]> git.pld-linux.org Git - packages/vagrant.git/blame - vagrant.sh
- release 3 (by relup.sh)
[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
25 if [ -f "${needle}/lib/vagrant/pre-rubygems.rb" ]; then
26 VAGRANT_GEM_PATH="${needle}"
27 fi
28done
29
30VAGRANT_EXECUTABLE="${VAGRANT_GEM_PATH}/bin/vagrant"
31VAGRANT_LAUNCHER="${VAGRANT_GEM_PATH}/lib/vagrant/pre-rubygems.rb"
32
33# Export the VAGRANT_EXECUTABLE so that pre-rubygems can optimize a bit
34export VAGRANT_EXECUTABLE
35
36# Call the actual Vagrant bin with our arguments
37exec "${RUBY_EXECUTABLE}" "${VAGRANT_LAUNCHER}" "$@"
This page took 0.058376 seconds and 4 git commands to generate.