-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathinstall.sh
executable file
·54 lines (50 loc) · 1002 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#
# usage: ./install.sh $(pwd) # for myrc path
CONFIG_FILES=(
.common_alias
.bashrc
.tmux.conf
.vimrc
.yarnrc
.zshrc
.secret
.my_alias
bin
.tmuxp
.gitmodules
.gitignore_global
.gitconfig
.gitattributes
.dircolors
.config
.zshrc.pre-oh-my-zsh
)
MY_RC_PATH=$1
# backpack dir
if [ -d ~/old_rcfiles ]
then
echo "backpack dir already exists!"
else
echo "backpack dir doesn't exist, create '~/old_rcfiles' instead"
mkdir ~/old_rcfiles
fi
# backpack the old rc files
# make soft link to myrc
for file in ${CONFIG_FILES[@]}
do
if [ -f ~/${file} ]
then
echo "${file} already exist!"
mv ~/${file} ~/old_rcfiles
elif [ -h ~/${file} ]
then
echo "${file} is soft link, move to old_rcfiles"
mv ~/${file} ~/old_rcfiles
else
echo "${file} doesn't exist!"
fi
ln -s $MY_RC_PATH/${file} ~/${file}
done
# post install
/usr/local/opt/fzf/install