improve install script

This commit is contained in:
Nachuan Tang
2022-09-04 00:34:35 -04:00
parent 5d36eef71d
commit 540b04e49e
+20 -15
View File
@@ -192,21 +192,8 @@ set_up_vim() {
setup_vimplug setup_vimplug
} }
set_up_zoxide() { # zoxide requres extra shell configuration setup
# https://github.com/ajeetdsouza/zoxide set_up_zoxide_shell_config() {
if program_exists "zoxide"; then
success "zoxide is already installed"
return 0
fi
echo "Install zoxide (smart cd like autojump)?('y' install; 'q' quit the scrip)"
read -r respond
if [ "$respond" = "y" ] || [ "$respond" = "yes" ]; then
program_must_exist "curl"
# This will install zoxide into ~/.local
curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash
local source_cmd_zsh='eval "$(zoxide init zsh)"' local source_cmd_zsh='eval "$(zoxide init zsh)"'
local source_cmd_bash='eval "$(zoxide init bash)"' local source_cmd_bash='eval "$(zoxide init bash)"'
if program_exists "zsh"; then if program_exists "zsh"; then
@@ -240,6 +227,24 @@ set_up_zoxide() {
success "add ($source_cmd_bash) to bash" success "add ($source_cmd_bash) to bash"
fi fi
fi fi
}
set_up_zoxide() {
# https://github.com/ajeetdsouza/zoxide
if program_exists "zoxide"; then
success "zoxide is already installed"
set_up_zoxide_shell_config
return 0
fi
echo "Install zoxide (smart cd like autojump)?('y' install; 'q' quit the scrip)"
read -r respond
if [ "$respond" = "y" ] || [ "$respond" = "yes" ]; then
program_must_exist "curl"
# This will install zoxide into ~/.local
curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash
set_up_zoxide_shell_config
elif [ "$respond" = "q" ]; then elif [ "$respond" = "q" ]; then
exit 0 exit 0