This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
avsh_singlefile_template.tpl
38 lines (30 loc) · 1.63 KB
/
avsh_singlefile_template.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# avsh v%{avsh_version} - Augmented Vagrant sSH
# Homepage: https://github.com/MasonM/avsh
# Bugs: https://github.com/MasonM/avsh/issues
set -e -u
# We want to use the Ruby version that Vagrant uses to reduce possible
# compatibility issues when evaluating the Vagrantfile. Thankfully, the Vagrant
# installer uses a bog standard Ruby compiled from source by a Puppet class:
# https://github.com/mitchellh/vagrant-installers/blob/master/substrate/modules/ruby/manifests/source.pp
#
# The location of the embeded Ruby installation is /opt/vagrant/embedded/ for
# Linux and OS X, which is defined at https://github.com/mitchellh/vagrant-installers/tree/master/package/support
# However, old versions of Vagrant for OS X used /Applications/Vagrant/, so we
# ought to check for that too.
for possible_ruby in "/opt/vagrant/embedded/bin/ruby" "/Applications/Vagrant/embedded/bin/ruby" "ruby"; do
if command -v "$possible_ruby" > /dev/null 2>&1; then
# The -x flag tells Ruby to ignore everything up to the "#!ruby"
# The --disable-gems flag is for performance, since we don't need any gems
# The --disable-rubyopt flag is to prevent the RUBOPT environment variable
# from interfering with this script.
exec "$possible_ruby" -x --disable-gems --disable-rubyopt -- "$0" "$@"
fi
done
echo "avsh was unable to find a suitable Ruby interpreter.
This usually means Vagrant was not installed via your OS package manager or https://www.vagrantup.com/downloads.html
If that is not the case, please file an issue at https://github.com/MasonM/avsh/issues/new and include how you installed Vagrant"
exit 1
#!ruby
%{avsh_libs}
Avsh::CLI.run()