mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-29 09:10:07 +00:00
feat(z): update z to latest version (#10267)
This commit is contained in:
parent
bf7c1b160d
commit
7418814677
1 changed files with 10 additions and 6 deletions
|
@ -42,6 +42,8 @@ _z() {
|
||||||
[ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return
|
[ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return
|
||||||
|
|
||||||
_z_dirs () {
|
_z_dirs () {
|
||||||
|
[ -f "$datafile" ] || return
|
||||||
|
|
||||||
local line
|
local line
|
||||||
while read line; do
|
while read line; do
|
||||||
# only count directories
|
# only count directories
|
||||||
|
@ -54,14 +56,16 @@ _z() {
|
||||||
if [ "$1" = "--add" ]; then
|
if [ "$1" = "--add" ]; then
|
||||||
shift
|
shift
|
||||||
|
|
||||||
# $HOME isn't worth matching
|
# $HOME and / aren't worth matching
|
||||||
[ "$*" = "$HOME" ] && return
|
[ "$*" = "$HOME" -o "$*" = '/' ] && return
|
||||||
|
|
||||||
# don't track excluded directory trees
|
# don't track excluded directory trees
|
||||||
local exclude
|
if [ ${#_Z_EXCLUDE_DIRS[@]} -gt 0 ]; then
|
||||||
for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
|
local exclude
|
||||||
case "$*" in "$exclude*") return;; esac
|
for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
|
||||||
done
|
case "$*" in "$exclude"*) return;; esac
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# maintain the data file
|
# maintain the data file
|
||||||
local tempfile="$datafile.$RANDOM"
|
local tempfile="$datafile.$RANDOM"
|
||||||
|
|
Loading…
Reference in a new issue