-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
59 lines (47 loc) · 1.92 KB
/
setup.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
55
56
57
58
59
#!/bin/sh
# Author: Jim Jing
# Date: Dec 21 2014
root_dir=$PWD
###################
# section for git #
###################
default_git_config_file_name=".gitconfig"
custom_git_config_file_name="mygitconfig"
# Check if default git config exist
echo "[GIT] Installing customized git config..."
if [ -e "$HOME/$default_git_config_file_name" ]
then
echo "[include]" >> $HOME/$default_git_config_file_name
echo "\tpath = $root_dir/$custom_git_config_file_name" >> $HOME/$default_git_config_file_name
else
echo "[GIT] "$HOME/$default_git_config_file_name" does not exist. Abort installing git config."
fi
echo "[GIT] Customized git config installed at $root_dir/$custom_git_config_file_name"
############################
# section for bash_aliases #
############################
default_bash_aliases_config_file_name=".bash_aliases"
custom_bash_aliases_config_file_name=".bash_aliases"
# Check if default bash_aliases config exist
echo "[BASH] Installing customized bash_aliases config..."
if [ -e "$HOME/$default_bash_aliases_config_file_name" ]
then
echo "[BASH] "$HOME/$default_bash_aliases_config_file_name" exists. Abort installing bash_aliases config."
else
cp $root_dir/$custom_bash_aliases_config_file_name $HOME/$default_bash_aliases_config_file_name
fi
echo "[BASH] Customized bash_aliases config installed at $root_dir/$custom_bash_aliases_config_file_name"
####################
# section for tmux #
####################
default_tmux_config_file_name=".tmux.conf"
custom_tmux_config_file_name=".tmux.conf"
# Check if default tmux config exist
echo "[TMUX] Installing customized tmux config..."
if [ -e "$HOME/$default_tmux_config_file_name" ]
then
echo "[TMUX] "$HOME/$default_tmux_config_file_name" exists. Abort installing tmux config."
else
cp $root_dir/$custom_tmux_config_file_name $HOME/$default_tmux_config_file_name
fi
echo "[TMUX] Customized tmux config installed at $root_dir/$custom_tmux_config_file_name"