-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·39 lines (31 loc) · 1.22 KB
/
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
#!/bin/sh
#SCRIPT=$(readlink -f $0)
#SCRIPTPATH=$(dirname ${SCRIPT})
SCRIPTPATH=.
install_to="${1:-$HOME}"
cp -fr ${SCRIPTPATH}/.bashrc* ${install_to}
cp -fr ${SCRIPTPATH}/.mybashrc ${install_to}
cp -fr ${SCRIPTPATH}/.vimrc ${install_to}
cp -fr ${SCRIPTPATH}/.inputrc ${install_to}
cp -fr ${SCRIPTPATH}/.tmux* ${install_to}
cp -fr ${SCRIPTPATH}/.eslintrc.json ${install_to}
cp -fr ${SCRIPTPATH}/.jshintrc ${install_to}
#zsh specific
if [[ "${SHELL}" == "/bin/zsh" ]]; then
cp -fr ${SCRIPTPATH}/.tmux.conf.zsh ${install_to}/.tmux.conf
fi
#source ${HOME}/.bashrc
# install vscode setting
vscode_user_dir=${install_to}/.config/Code/User
if [[ -d ${vscode_user_dir} ]]; then
if [[ -f ${vscode_user_dir}/settings.json ]]; then
# backup
mv ${vscode_user_dir}/settings.json ${vscode_user_dir}/settings.json-before-dotfiles-install.backup
ln -sf ${SCRIPTPATH}/vscode/User/settings.json ${vscode_user_dir}/settings.json
fi
if [[ -f ${vscode_user_dir}/keybindings.json ]]; then
# backup
mv ${vscode_user_dir}/keybindings.json ${vscode_user_dir}/keybindings.json-before-dotfiles-install.backup
ln -sf ${SCRIPTPATH}/vscode/User/keybindings.json ${vscode_user_dir}/keybindings.json
fi
fi