Compare commits
1 Commits
7b549f01e5
...
2e5b8aef8a
Author | SHA1 | Date | |
---|---|---|---|
2e5b8aef8a |
@ -66,8 +66,8 @@ _autoenv_exit() {
|
|||||||
_autoenv_entered[${_autoenv_entered[(i)$entered]}]=()
|
_autoenv_entered[${_autoenv_entered[(i)$entered]}]=()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Find all directories containing a .enter file by searching up the directory
|
# Find a directory containing a .enter file by searching up the directory tree
|
||||||
# tree starting in the current directory.
|
# starting in the current directory.
|
||||||
_autoenv_find_enter_directories() {
|
_autoenv_find_enter_directories() {
|
||||||
local current=$PWD
|
local current=$PWD
|
||||||
# If an enter script is found in the current directory, return it.
|
# If an enter script is found in the current directory, return it.
|
||||||
@ -78,8 +78,7 @@ _autoenv_find_enter_directories() {
|
|||||||
local next=$current/..; local next=${next:A}
|
local next=$current/..; local next=${next:A}
|
||||||
# If an enter script is found in the current directory, return it.
|
# If an enter script is found in the current directory, return it.
|
||||||
[ -f $next/.enter ] && echo $next
|
[ -f $next/.enter ] && echo $next
|
||||||
# If the current directory equals the next directory we are done, otherwise
|
# If the current directory equals the next directory, return.
|
||||||
# update the current directory.
|
|
||||||
[[ $current == $next ]] && return || local current=$next
|
[[ $current == $next ]] && return || local current=$next
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user