vagrant-1.9.1 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/usr/bin/env bash
  2. #
  3. # This is a wrapper to properly execute Vagrant within the embedded
  4. # Vagrant installation directory. This sets up proper environmental variables
  5. # so that everything loads and compiles to proper directories.
  6. VAGRANT_DIR="$( ruby -e 'print Gem::default_path[-1] + "/gems/vagrant-1.9.1"' )"
  7. # Export GEM_HOME based on VAGRANT_HOME
  8. #
  9. # This needs to be set because Bundler includes gem paths
  10. # from RubyGems' Gem.paths.
  11. if [ -z $VAGRANT_HOME ]; then
  12. VAGRANT_HOME=$(eval echo "~/.vagrant.d")
  13. fi
  14. export GEM_HOME="$VAGRANT_HOME/gems"
  15. # SSL certs
  16. export SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
  17. # Export an environmental variable to say we're in a Vagrant
  18. # installer created environment.
  19. export VAGRANT_INSTALLER_ENV=1
  20. # This is currently used only in Vagrant::Plugin::Manager.system_plugins_file
  21. # to locate plugins configuration file.
  22. export VAGRANT_INSTALLER_EMBEDDED_DIR="/var/lib/vagrant"
  23. export VAGRANT_INSTALLER_VERSION="2"
  24. # Determine the OS that we're on, which is used in some later checks.
  25. # It is very important we do this _before_ setting the PATH below
  26. # because uname dependencies can conflict on some platforms.
  27. OS=$(uname -s 2>/dev/null)
  28. # Export the OS as an environmental variable that Vagrant can access
  29. # so that it can behave better.
  30. export VAGRANT_DETECTED_OS="${OS}"
  31. VAGRANT_EXECUTABLE="${VAGRANT_DIR}/bin/vagrant"
  32. # Export the VAGRANT_EXECUTABLE so that pre-rubygems can optimize a bit
  33. export VAGRANT_EXECUTABLE
  34. # Call the actual Vagrant bin with our arguments
  35. exec ruby "${VAGRANT_EXECUTABLE}" "$@"