-
Notifications
You must be signed in to change notification settings - Fork 2
/
update.sh
executable file
·50 lines (46 loc) · 965 Bytes
/
update.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
#!/bin/bash
# collect system info
dir_name=`dirname $0`
CUR_PATH="`pwd`${dir_name:1}"
SHELLTYPE=`echo $SHELL | cut -d'/' -f3`
function update_configs(){
cd ${CUR_PATH}
git pull
echo "What setting you want to update?"
echo "[D]efault setting / 42S[E]OUL setting"
read upd_ans
case "$upd_ans" in
[dD])
cp ./.vimrc_default ~/.vimrc
;;
[eE])
cp ./.vimrc_42seoul ~/.vimrc
;;
*)
echo -e "wrong command!!\n"
exit 1
;;
esac
echo "color jellybeans" >> ~/.vimrc
}
function update_plugins(){
vim -c "PlugUpdate" -c "PlugUpgrade" -c "q" -c "q" 2>/dev/null
}
#Script starts from here
update_configs
update_plugins
# echo `echo $SHELL | find -exec cmd {}\`
echo "Do you want to set alias update_vim=bash {current_path}/update.sh ?"
echo "([Y]es / [N]o)"
read res
case "$res" in
[yY])
shopt -s expand_aliases
echo alias update_vim=\'bash \${CUR_PATH}\/update\.sh\' >> ~/.${SHELLTYPE}rc
;;
[nN])
;;
*)
echo "wrong command"
;;
esac