From: Erich Smith Date: Sun, 13 May 2012 12:35:30 +0000 (-0400) Subject: disable z() if fasd is enabled X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=8051a8520e436dd11e96cbaf04f1957302d526fc;p=common%2Fbash_it.git 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. --- diff --git a/plugins/available/z.plugin.bash b/plugins/available/z.plugin.bash index 7ffe8fb..14a6543 100644 --- a/plugins/available/z.plugin.bash +++ b/plugins/available/z.plugin.bash @@ -15,6 +15,11 @@ about-plugin ' z is DEPRECATED, use fasd instead' # * z -t foo # goes to most recently accessed dir matching foo # * 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() { local datafile="$HOME/.z" if [ "$1" = "--add" ]; then