mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Consolidate source calls to use autojump.sh. Modify autojump.sh to support
custom installations.
This commit is contained in:
parent
44c066d21d
commit
8b13949173
@ -10,4 +10,8 @@ if [ -s ~/.autojump/etc/profile.d/autojump.${shell} ]; then
|
||||
elif [ -s /etc/profile.d/autojump.${shell} ]; then
|
||||
source /etc/profile.d/autojump.${shell}
|
||||
|
||||
# check custom install locations (modified by Homebrew or using --destdir option)
|
||||
elif [ -s custom_install/autojump.${shell} ]; then
|
||||
source custom_install/autojump.${shell}
|
||||
|
||||
fi
|
||||
|
11
install.sh
11
install.sh
@ -29,6 +29,7 @@ function help_msg {
|
||||
|
||||
dry_run=
|
||||
local=
|
||||
global=
|
||||
force=
|
||||
shell=`echo ${SHELL} | awk -F/ '{ print $NF }'`
|
||||
destdir=
|
||||
@ -65,6 +66,7 @@ while true; do
|
||||
fi
|
||||
;;
|
||||
-g|--global)
|
||||
global=true
|
||||
destdir=
|
||||
prefix=usr
|
||||
shift
|
||||
@ -213,15 +215,20 @@ cp -v ./bin/autojump.zsh ${destdir}etc/profile.d/ || exit 1
|
||||
mkdir -p ${destdir}${zshsharedir} || exit 1
|
||||
install -v -m 0755 ./bin/_j ${destdir}${zshsharedir} || exit 1
|
||||
|
||||
# MODIFY AUTOJUMP.SH FOR CUSTOM INSTALLS
|
||||
if [[ -z ${local} ]] && [[ -z ${global} ]]; then
|
||||
sed -i "s:custom_install:${destdir}etc/profile.d:g" ${destdir}etc/profile.d/autojump.sh
|
||||
fi
|
||||
|
||||
# DISPLAY ADD MESSAGE
|
||||
rc_file="~/.${shell}rc"
|
||||
if [[ `uname` == "Darwin" ]] && [[ ${shell} == "bash" ]]; then
|
||||
rc_file="~/.bash_profile"
|
||||
fi
|
||||
|
||||
aj_shell_file="${destdir}etc/profile.d/autojump.${shell}"
|
||||
aj_shell_file="${destdir}etc/profile.d/autojump.sh"
|
||||
if [[ ${local} ]]; then
|
||||
aj_shell_file="~/.autojump/etc/profile.d/autojump.${shell}"
|
||||
aj_shell_file="~/.autojump/etc/profile.d/autojump.sh"
|
||||
fi
|
||||
|
||||
echo
|
||||
|
Loading…
Reference in New Issue
Block a user