mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
Updated _chef_root function to use directory:h
This commit is contained in:
parent
412e0814f5
commit
20fc428485
1 changed files with 2 additions and 3 deletions
|
|
@ -230,12 +230,11 @@ _cookbook_versions() {
|
|||
# Searches up from current directory to find the closest folder that has a .chef folder
|
||||
# Useful for the knife upload/from file commands
|
||||
_chef_root () {
|
||||
slashes=${PWD//[^\/]/}
|
||||
directory="$PWD"
|
||||
for (( n=${#slashes}; n>0; --n ))
|
||||
while [ $directory != '/' ]
|
||||
do
|
||||
test -e "$directory/.chef" && echo "$directory" && return
|
||||
directory="$directory/.."
|
||||
directory="${directory:h}"
|
||||
done
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue