mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Merge pull request #11 from telemachus/param-expansion
Use parameter expansion for basename + dirname
This commit is contained in:
commit
c3089c8439
1 changed files with 2 additions and 2 deletions
|
@ -5,8 +5,8 @@ abs_dirname() {
|
|||
local path="$1"
|
||||
|
||||
while [ -n "$path" ]; do
|
||||
cd "$(dirname "$path")"
|
||||
local name="$(basename "$path")"
|
||||
cd "${path%/*}"
|
||||
local name="${path##*/}"
|
||||
path="$(readlink "$name" || true)"
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in a new issue