* better check if a cmd exists
This commit is contained in:
Dict Xiong 2022-05-21 02:57:20 +08:00 committed by GitHub
parent e247588a51
commit d5bf057e65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,24 +185,21 @@ uninstall_crontab(){
install_tmux_tpm(){ install_tmux_tpm(){
TMUX_TPM="$HOME/.tmux/plugins/tpm" TMUX_TPM="$HOME/.tmux/plugins/tpm"
command -v tmux > /dev/null 2>&1 if [[ -x $(command -v tmux) && ! -d "$TMUX_TPM" ]]; then
if [[ $? == 0 && ! -d "$TMUX_TPM" ]]; then
fmt_note "installing tmux tpm ..." fmt_note "installing tmux tpm ..."
git clone https://hub.fastgit.xyz/tmux-plugins/tpm "$TMUX_TPM" git clone https://hub.fastgit.xyz/tmux-plugins/tpm "$TMUX_TPM"
command -v g++ > /dev/null 2>&1 if [[ -x $(command -v g++) && -x $(command -v cmake) ]]; then
if [[ $? == 0 ]]; then
fmt_note "initializing tmux plugins ..." fmt_note "initializing tmux plugins ..."
~/.tmux/plugins/tpm/bin/install_plugins ~/.tmux/plugins/tpm/bin/install_plugins
else else
fmt_warning "pls install g++ and init tmux plugins by <prefix + I>" fmt_warning "pls install g++ and cmake and then init tmux plugins by <prefix + I>"
fi fi
fi fi
} }
install_vim_vundle(){ install_vim_vundle(){
VIM_VUNDLE="$HOME/.vim/bundle/Vundle.vim" VIM_VUNDLE="$HOME/.vim/bundle/Vundle.vim"
command -v vim > /dev/null 2>&1 if [[ -x $(command -v vim) && ! -d "$VIM_VUNDLE" ]]; then
if [[ $? == 0 && ! -d "$VIM_VUNDLE" ]]; then
fmt_note "installing vim vundle ..." fmt_note "installing vim vundle ..."
git clone https://hub.fastgit.xyz/gmarik/Vundle.vim.git "$VIM_VUNDLE" git clone https://hub.fastgit.xyz/gmarik/Vundle.vim.git "$VIM_VUNDLE"
fmt_note "initializing vim plugins ..." fmt_note "initializing vim plugins ..."