2011-08-02 19:11:41 -04:00
|
|
|
#!/usr/bin/env bash -e
|
2011-08-01 16:50:26 -04:00
|
|
|
|
2011-08-03 13:17:28 -04:00
|
|
|
make_shims() {
|
|
|
|
local glob="$@"
|
2011-08-01 16:50:26 -04:00
|
|
|
|
2011-08-03 13:17:28 -04:00
|
|
|
for file in $glob; do
|
|
|
|
local shim="${file##*/}"
|
|
|
|
cat > "$shim" <<SH
|
2011-08-02 19:50:44 -04:00
|
|
|
#!/bin/sh
|
2011-08-02 20:37:18 -04:00
|
|
|
exec rbenv exec $shim "\$@"
|
2011-08-02 19:50:44 -04:00
|
|
|
SH
|
2011-08-03 13:17:28 -04:00
|
|
|
chmod +x "$shim"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir -p "${HOME}/.rbenv/shims"
|
|
|
|
cd "${HOME}/.rbenv/shims"
|
|
|
|
rm -f *
|
|
|
|
|
|
|
|
make_shims ../versions/*/bin/*
|
|
|
|
|
|
|
|
shopt -s nullglob
|
|
|
|
RBENV_REHASH_PLUGINS=(/etc/rbenv.d/rehash/*.bash ${HOME}/.rbenv/rbenv.d/rehash/*.bash)
|
|
|
|
shopt -u nullglob
|
|
|
|
|
|
|
|
for script in $RBENV_REHASH_PLUGINS; do
|
|
|
|
source $script
|
2011-08-01 16:50:26 -04:00
|
|
|
done
|