From 2a0324359d9e7d418b1cc54edcaae68381a1e4fe Mon Sep 17 00:00:00 2001 From: Alexander Suvorov Date: Sun, 24 Sep 2017 13:04:29 +0300 Subject: [PATCH] Allow install config from any directory Also small fixes: - unify all home-dir instances; - return back to the directory where install.sh was called from; --- install.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index 970e4b8..5c25d7c 100755 --- a/install.sh +++ b/install.sh @@ -1,28 +1,30 @@ +#!/bin/bash + # Author arthurkiller # email arthur-lee@qq.com # data 2017-1-4 # this shell is used for initialize the tmux-config -#!/bin/bash - trap exit ERR -if [ -d $HOME/.tmux ] +if [ -d ~/.tmux ] then echo .tmux already exist - mv $HOME/.tmux $HOME/.tmux.bak + mv ~/.tmux ~/.tmux.bak fi -if [ -e $HOME/.tmux.conf ] +if [ -e ~/.tmux.conf ] then echo .tmux.conf already exist - mv $HOME/.tmux.conf $HOME/.tmux.conf.bak + mv ~/.tmux.conf ~/.tmux.conf.bak fi -cp -r $HOME/tmux-config $HOME/.tmux -ln -s $HOME/.tmux/.tmux.conf $HOME/.tmux.conf +cp -r . ~/.tmux +ln -s ~/.tmux/.tmux.conf ~/.tmux.conf -cd ~/.tmux && git submodule init && git submodule update +pushd ~/.tmux && git submodule init && git submodule update cd ~/.tmux/vendor/tmux-mem-cpu-load && cmake . && make && sudo make install tmux source-file ~/.tmux.conf + +popd