Skip to content

Commit

Permalink
Migrate old default values of Z_EXCLUDE to keep ignoring $HOME
Browse files Browse the repository at this point in the history
See #90
  • Loading branch information
krobelus committed Aug 23, 2020
1 parent f44ea94 commit 78861a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions conf.d/z.fish
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ end

if not set -q Z_EXCLUDE
set -U Z_EXCLUDE "^$HOME\$"
else if contains $HOME $Z_EXCLUDE
# Workaround: migrate old default values to a regex (see #90).
set Z_EXCLUDE (string replace -r -- "^$HOME\$" '^'$HOME'$$' $Z_EXCLUDE)
end

# Setup completions once first
Expand Down
2 changes: 1 addition & 1 deletion man/man1/z.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ For more details about frecency, see https://github.com/rupa/z.
Exclude all directories matching the regex from being added to the
z-store in the future. This does not modify the existing store.

For example `set -P Z_EXCLUDE "^/mnt/workVPN"` will block all paths starting
For example `set -p Z_EXCLUDE "^/mnt/workVPN"` will block all paths starting
with `/mnt/workVPN`. `set -P Z_EXCLUDE "^/mnt/workVPN\$"` would exclude
exactly that directory, but not any of `/mnt/workVPN`'s subdirectories.

0 comments on commit 78861a8

Please sign in to comment.