Skip to content

Commit 2a03243

Browse files
author
Alexander Suvorov
committed
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;
1 parent 4e6c638 commit 2a03243

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

install.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1+
#!/bin/bash
2+
13
# Author arthurkiller
24
# email arthur-lee@qq.com
35
# data 2017-1-4
46
# this shell is used for initialize the tmux-config
57

6-
#!/bin/bash
7-
88
trap exit ERR
9-
if [ -d $HOME/.tmux ]
9+
if [ -d ~/.tmux ]
1010
then
1111
echo .tmux already exist
12-
mv $HOME/.tmux $HOME/.tmux.bak
12+
mv ~/.tmux ~/.tmux.bak
1313
fi
1414

15-
if [ -e $HOME/.tmux.conf ]
15+
if [ -e ~/.tmux.conf ]
1616
then
1717
echo .tmux.conf already exist
18-
mv $HOME/.tmux.conf $HOME/.tmux.conf.bak
18+
mv ~/.tmux.conf ~/.tmux.conf.bak
1919
fi
2020

21-
cp -r $HOME/tmux-config $HOME/.tmux
22-
ln -s $HOME/.tmux/.tmux.conf $HOME/.tmux.conf
21+
cp -r . ~/.tmux
22+
ln -s ~/.tmux/.tmux.conf ~/.tmux.conf
2323

24-
cd ~/.tmux && git submodule init && git submodule update
24+
pushd ~/.tmux && git submodule init && git submodule update
2525

2626
cd ~/.tmux/vendor/tmux-mem-cpu-load && cmake . && make && sudo make install
2727

2828
tmux source-file ~/.tmux.conf
29+
30+
popd

0 commit comments

Comments
 (0)