1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

install type is determined by /bin/zsh env var

This commit is contained in:
William Ting 2012-03-15 10:16:33 -10:00
parent 448696ef9b
commit bbe54c3b22

View File

@ -39,7 +39,7 @@ function help_msg {
# Default install directory.
prefix=/usr
shell="bash"
shell=`echo ${SHELL} | awk -F/ '{ print $NF }'`
local=
user=${SUDO_USER:-${USER}}
@ -55,6 +55,10 @@ bashrc_file=${user_home}/.bashrc
# Command line parsing
while true; do
case "$1" in
-b|--bash)
shell="bash"
shift
;;
-h|--help|-\?)
help_msg;
exit 0
@ -91,6 +95,15 @@ while true; do
esac
done
# check shell if supported
if [[ ${shell} != "bash" ]] && [[ ${shell} != "zsh" ]]; then
echo "Unsupported shell (${shell}). Use --bash or --zsh to explicitly define shell."
exit 1
else
echo "Installing ${shell} version."
exit 0
fi
# check Python version
python_version=`python -c 'import sys; print(sys.version_info[:])'`
if [[ ${python_version:1:1} -eq 2 && ${python_version:4:1} -lt 6 ]]; then