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:
parent
448696ef9b
commit
bbe54c3b22
15
install.sh
15
install.sh
@ -39,7 +39,7 @@ function help_msg {
|
|||||||
|
|
||||||
# Default install directory.
|
# Default install directory.
|
||||||
prefix=/usr
|
prefix=/usr
|
||||||
shell="bash"
|
shell=`echo ${SHELL} | awk -F/ '{ print $NF }'`
|
||||||
local=
|
local=
|
||||||
|
|
||||||
user=${SUDO_USER:-${USER}}
|
user=${SUDO_USER:-${USER}}
|
||||||
@ -55,6 +55,10 @@ bashrc_file=${user_home}/.bashrc
|
|||||||
# Command line parsing
|
# Command line parsing
|
||||||
while true; do
|
while true; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
-b|--bash)
|
||||||
|
shell="bash"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-h|--help|-\?)
|
-h|--help|-\?)
|
||||||
help_msg;
|
help_msg;
|
||||||
exit 0
|
exit 0
|
||||||
@ -91,6 +95,15 @@ while true; do
|
|||||||
esac
|
esac
|
||||||
done
|
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
|
# check Python version
|
||||||
python_version=`python -c 'import sys; print(sys.version_info[:])'`
|
python_version=`python -c 'import sys; print(sys.version_info[:])'`
|
||||||
if [[ ${python_version:1:1} -eq 2 && ${python_version:4:1} -lt 6 ]]; then
|
if [[ ${python_version:1:1} -eq 2 && ${python_version:4:1} -lt 6 ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user