disable z() if fasd is enabled

loading fasd clobbers z(), and results in a cryptic syntax error
message, since 'z' is already an alias when z.plugin.bash is being
sourced.

this conditional detects this situation and returns early.
pull/134/head
Erich Smith 2012-05-13 08:35:30 -04:00
parent 55e77deac1
commit 8051a8520e
1 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,11 @@ about-plugin ' z is DEPRECATED, use fasd instead'
# * z -t foo # goes to most recently accessed dir matching foo # * z -t foo # goes to most recently accessed dir matching foo
# * z -l foo # list all dirs matching foo (by frecency) # * z -l foo # list all dirs matching foo (by frecency)
if [ -h $BASH_IT/plugins/enabled/fasd.plugin.bash ]; then
printf '%s\n' 'sorry, the z plugin is incompatible with the fasd plugin. you may use either, but not both.'
return
fi
z() { z() {
local datafile="$HOME/.z" local datafile="$HOME/.z"
if [ "$1" = "--add" ]; then if [ "$1" = "--add" ]; then