allowing z plugin to use a custom path

This commit is contained in:
Bruno Pinto 2013-11-20 08:20:34 -02:00
parent 81c57572ac
commit 62928f9aa5
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,3 @@
function z
cd (bash -c 'source /usr/local/etc/profile.d/z.sh; _z $0; echo $PWD' $argv)
cd (bash -c 'source $Z_SCRIPT_PATH; _z $0; echo $PWD' $argv)
end

View File

@ -1,5 +1,9 @@
if test -z "$Z_SCRIPT_PATH"
set -x Z_SCRIPT_PATH /usr/local/etc/profile.d/z.sh
end
function __check_z --on-variable PWD --description 'Setup z on directory change'
status --is-command-substitution; and return
bash -c "source /usr/local/etc/profile.d/z.sh; _z --add `pwd -P`"
bash -c "source $Z_SCRIPT_PATH; _z --add `pwd -P`"
end