Skip to content

Commit

Permalink
feat(z): update z to latest version (ohmyzsh#10267)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzgry authored and kareefardi committed Oct 27, 2021
1 parent 45cc491 commit e90d1fc
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions plugins/z/z.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ _z() {
[ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return

_z_dirs () {
[ -f "$datafile" ] || return

local line
while read line; do
# only count directories
Expand All @@ -54,14 +56,16 @@ _z() {
if [ "$1" = "--add" ]; then
shift

# $HOME isn't worth matching
[ "$*" = "$HOME" ] && return
# $HOME and / aren't worth matching
[ "$*" = "$HOME" -o "$*" = '/' ] && return

# don't track excluded directory trees
local exclude
for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
case "$*" in "$exclude*") return;; esac
done
if [ ${#_Z_EXCLUDE_DIRS[@]} -gt 0 ]; then
local exclude
for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
case "$*" in "$exclude"*) return;; esac
done
fi

# maintain the data file
local tempfile="$datafile.$RANDOM"
Expand Down

0 comments on commit e90d1fc

Please sign in to comment.