comparison setup @ 5:de6ce93d40fc

Added action message. Fixed missed files.
author Edho Prima Arief <me@myconan.net>
date Sat, 17 Jul 2010 02:32:30 +0700
parents 94ee419ad047
children 2ae8e6222b9d
comparison
equal deleted inserted replaced
4:94ee419ad047 5:de6ce93d40fc
1 #!/bin/sh 1 #!/bin/sh
2 2
3 install() { 3 install() {
4 uninstall
4 #create symlinks 5 #create symlinks
5 linker "tcsh" ".tcsh_init" 6 linker "tcsh" ".tcsh_init"
6 linker "tmux" ".tmux.conf" 7 linker "tmux" ".tmux.conf"
7 linker "hg" ".hgrc" 8 linker "hg" ".hgrc"
8 linker "vim" ".vimrc" 9 linker "vim" ".vimrc"
9 linker "bin" "bin-ec" 10 linker "bin" "bin-ec"
10 11
11 #modify cshrc 12 #modify cshrc
12 uninstall_tcsh
13 echo '[ -r "${HOME}/.tcsh_init" ] && source "${HOME}/.tcsh_init" #ECCORE_TCSH' >> "${HOME}/.cshrc" 13 echo '[ -r "${HOME}/.tcsh_init" ] && source "${HOME}/.tcsh_init" #ECCORE_TCSH' >> "${HOME}/.cshrc"
14 } 14 }
15 15
16 linker() { 16 linker() {
17 echo "Creating symlink: ${1} => ~/${2}"
17 ln -fs "${PWD}/${1}" "${HOME}/${2}" 18 ln -fs "${PWD}/${1}" "${HOME}/${2}"
18 } 19 }
19 20
20 uninstall_tcsh() { 21 uninstall_tcsh() {
21 if [ -e "${HOME}/.cshrc" ]; then 22 if [ -e "${HOME}/.cshrc" ]; then
23 mv .cleancshrc "${HOME}/.cshrc" 24 mv .cleancshrc "${HOME}/.cshrc"
24 fi 25 fi
25 } 26 }
26 27
27 uninstall() { 28 uninstall() {
28 for i in .tcsh_init .tmux_conf .hgrc .vimrc; do 29 for i in .tcsh_init .tmux.conf .hgrc .vimrc bin-ec; do
29 [ -e "${HOME}/${i}" ] && rm -f "${HOME}/${i}" 30 if [ -e "${HOME}/${i}" ]; then
31 echo "Removing file: ~/${i}"
32 rm -f "${HOME}/${i}"
33 fi
30 done 34 done
31 uninstall_tcsh 35 uninstall_tcsh
32 } 36 }
33 37
34 case "$1" in 38 case "$1" in