]> git.pld-linux.org Git - packages/vagrant.git/blob - vagrant.sh
lib/pre-rubygems.rb is gone
[packages/vagrant.git] / vagrant.sh
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
10 RUBY_EXECUTABLE="/usr/bin/ruby"
11
12 GEM_PATH=$($RUBY_EXECUTABLE -r rubygems -e 'puts Gem.respond_to?(:default_dirs) ? Gem.default_dirs[:system][:gem_dir] : Gem.path.first')
13 export GEM_PATH
14
15 # Export gem paths so it can find vagrant own gem
16 export GEM_HOME="${GEM_PATH}"
17
18 # Unset any RUBYOPT and RUBYLIB, we don't want these bleeding into our
19 # runtime.
20 unset RUBYOPT
21 unset RUBYLIB
22
23 # Find the Vagrant executable
24 for needle in "${GEM_PATH}/gems/vagrant-"*; do
25         if [ -f "${needle}/lib/vagrant/version.rb" ]; then
26                 VAGRANT_GEM_PATH="${needle}"
27         fi
28 done
29
30 VAGRANT_EXECUTABLE="${VAGRANT_GEM_PATH}/bin/vagrant"
31
32 # Call the actual Vagrant bin with our arguments
33 exec "$RUBY_EXECUTABLE" -r rubygems "$VAGRANT_EXECUTABLE" "$@"
This page took 0.062108 seconds and 3 git commands to generate.