diff --git a/bin/rbenv b/bin/rbenv deleted file mode 100755 index 30f1a18..0000000 --- a/bin/rbenv +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -e - -command="$1" -if [ -z "$command" ]; then - echo "rbenv 0.1.0" >&2 - -else - command_path="$(command -v "rbenv-$command" || true)" - if [ -z "$command_path" ]; then - echo "rbenv: no such command \`$command'" >&2 - exit 1 - fi - - shift 1 - exec "$command_path" "$@" -fi diff --git a/bin/rbenv b/bin/rbenv new file mode 120000 index 0000000..f1e9c5f --- /dev/null +++ b/bin/rbenv @@ -0,0 +1 @@ +../libexec/rbenv \ No newline at end of file diff --git a/libexec/rbenv b/libexec/rbenv new file mode 100755 index 0000000..253d08b --- /dev/null +++ b/libexec/rbenv @@ -0,0 +1,34 @@ +#!/bin/bash -e + +abs_dirname() { + orig_dir=`pwd` + path="$1" + while [ -n "$path" ]; do + cd `dirname "$path"` + name=`basename "$path"` + path=`readlink "$name" || true` + done + unset name path + + pwd + cd "$orig_dir" + unset orig_dir +} + +bindir=`abs_dirname $0` +export PATH="$bindir:$PATH" + +command="$1" +if [ -z "$command" ]; then + echo "rbenv 0.1.0" >&2 + +else + command_path="$(command -v "rbenv-$command" || true)" + if [ -z "$command_path" ]; then + echo "rbenv: no such command \`$command'" >&2 + exit 1 + fi + + shift 1 + exec "$command_path" "$@" +fi diff --git a/bin/rbenv-exec b/libexec/rbenv-exec similarity index 100% rename from bin/rbenv-exec rename to libexec/rbenv-exec diff --git a/bin/rbenv-path b/libexec/rbenv-path similarity index 100% rename from bin/rbenv-path rename to libexec/rbenv-path diff --git a/bin/rbenv-rehash b/libexec/rbenv-rehash similarity index 100% rename from bin/rbenv-rehash rename to libexec/rbenv-rehash diff --git a/bin/rbenv-set-default b/libexec/rbenv-set-default similarity index 100% rename from bin/rbenv-set-default rename to libexec/rbenv-set-default diff --git a/bin/rbenv-set-local b/libexec/rbenv-set-local similarity index 100% rename from bin/rbenv-set-local rename to libexec/rbenv-set-local diff --git a/bin/rbenv-shim b/libexec/rbenv-shim similarity index 100% rename from bin/rbenv-shim rename to libexec/rbenv-shim diff --git a/bin/rbenv-version b/libexec/rbenv-version similarity index 100% rename from bin/rbenv-version rename to libexec/rbenv-version diff --git a/bin/rbenv-versions b/libexec/rbenv-versions similarity index 100% rename from bin/rbenv-versions rename to libexec/rbenv-versions diff --git a/bin/rbenv-which b/libexec/rbenv-which similarity index 100% rename from bin/rbenv-which rename to libexec/rbenv-which