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
|
elif [ -s /etc/profile.d/autojump.${shell} ]; then
|
||||||
source /etc/profile.d/autojump.${shell}
|
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
|
fi
|
||||||
|
11
install.sh
11
install.sh
@ -29,6 +29,7 @@ function help_msg {
|
|||||||
|
|
||||||
dry_run=
|
dry_run=
|
||||||
local=
|
local=
|
||||||
|
global=
|
||||||
force=
|
force=
|
||||||
shell=`echo ${SHELL} | awk -F/ '{ print $NF }'`
|
shell=`echo ${SHELL} | awk -F/ '{ print $NF }'`
|
||||||
destdir=
|
destdir=
|
||||||
@ -65,6 +66,7 @@ while true; do
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
-g|--global)
|
-g|--global)
|
||||||
|
global=true
|
||||||
destdir=
|
destdir=
|
||||||
prefix=usr
|
prefix=usr
|
||||||
shift
|
shift
|
||||||
@ -213,15 +215,20 @@ cp -v ./bin/autojump.zsh ${destdir}etc/profile.d/ || exit 1
|
|||||||
mkdir -p ${destdir}${zshsharedir} || exit 1
|
mkdir -p ${destdir}${zshsharedir} || exit 1
|
||||||
install -v -m 0755 ./bin/_j ${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
|
# DISPLAY ADD MESSAGE
|
||||||
rc_file="~/.${shell}rc"
|
rc_file="~/.${shell}rc"
|
||||||
if [[ `uname` == "Darwin" ]] && [[ ${shell} == "bash" ]]; then
|
if [[ `uname` == "Darwin" ]] && [[ ${shell} == "bash" ]]; then
|
||||||
rc_file="~/.bash_profile"
|
rc_file="~/.bash_profile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
aj_shell_file="${destdir}etc/profile.d/autojump.${shell}"
|
aj_shell_file="${destdir}etc/profile.d/autojump.sh"
|
||||||
if [[ ${local} ]]; then
|
if [[ ${local} ]]; then
|
||||||
aj_shell_file="~/.autojump/etc/profile.d/autojump.${shell}"
|
aj_shell_file="~/.autojump/etc/profile.d/autojump.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
Loading…
Reference in New Issue
Block a user