From 735a2bc4e734257df9fdc5e3c398484d98eee0cc Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Tue, 2 Aug 2011 23:05:24 -0500 Subject: [PATCH] Consistent style --- libexec/rbenv | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/libexec/rbenv b/libexec/rbenv index 16e57108..31a2d242 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -1,22 +1,21 @@ #!/usr/bin/env bash -e abs_dirname() { - orig_dir=`pwd` - path="$1" + local cwd="$(pwd)" + local path="$1" + while [ -n "$path" ]; do - cd `dirname "$path"` - name=`basename "$path"` - path=`readlink "$name" || true` + cd "$(dirname "$path")" + local name="$(basename "$path")" + path="$(readlink "$name" || true)" done - unset name path pwd - cd "$orig_dir" - unset orig_dir + cd "$cwd" } -bindir=`abs_dirname $0` -export PATH="$bindir:$PATH" +libexec_path="$(abs_dirname "$0")" +export PATH="${libexec_path}:${PATH}" command="$1" if [ -z "$command" ]; then