[feature] skip installation if already installed

This commit is contained in:
Klesh Wong 2020-10-29 14:38:10 +08:00
parent 060f02c9ef
commit 3d4c28abc6

View File

@ -8,6 +8,7 @@ TMUX_VER=3.1b
# install ranger # install ranger
case "$PM" in case "$PM" in
apt) apt)
if which tmux &>/dev/null && [ "$(tmux -V)" != "tmux $TMUX_VER" ]; then
sudo apt install libevent-dev libncurses5-dev bison autoconf bc -y sudo apt install libevent-dev libncurses5-dev bison autoconf bc -y
TMUX_SRC_URL=https://github.com/tmux/tmux/releases/download/$TMUX_VER/tmux-$TMUX_VER.tar.gz TMUX_SRC_URL=https://github.com/tmux/tmux/releases/download/$TMUX_VER/tmux-$TMUX_VER.tar.gz
if in-china; then if in-china; then
@ -23,6 +24,7 @@ case "$PM" in
sudo make install sudo make install
popd popd
rm -rf /tmp/tmux* rm -rf /tmp/tmux*
fi
;; ;;
pacman) pacman)
sudo pacman -S --needed tmux bc sudo pacman -S --needed tmux bc
@ -31,4 +33,5 @@ esac
# symlink configuration # symlink configuration
lnsf $DIR/tmux.conf ~/.tmux.conf lnsf $DIR/tmux.conf ~/.tmux.conf
lnsf $DIR/config $XDG_CONFIG_HOME/tmux lnsf $DIR/config/tmux2.8.conf $XDG_CONFIG_HOME/tmux/tmux2.8.conf
lnsf $DIR/config/tmux2.9.conf $XDG_CONFIG_HOME/tmux/tmux2.9.conf