comparison setup @ 102:7a287a518718

Merge.
author Edho Prima Arief <edho@myconan.net>
date Thu, 18 Aug 2011 15:20:54 +0700
parents 54a82956bb11
children 7c01fc6f7460
comparison
equal deleted inserted replaced
89:29bd7f6ef58a 102:7a287a518718
1 #!/bin/sh 1 #!/bin/sh
2 2
3 install() { 3 install() {
4 uninstall 4 uninstall
5 #create symlinks 5 #create symlinks
6 linker "tcsh" ".tcsh_init" 6 linker "tcsh" ".ecos_tcsh"
7 linker "bash" ".ecos_bash" 7 linker "bash" ".ecos_bash"
8 linker "zsh" ".ecos_zsh"
8 linker "tmux" ".tmux.conf" 9 linker "tmux" ".tmux.conf"
9 linker "hg" ".hgrc" 10 linker "hg" ".hgrc"
10 linker "vim" ".vimrc" 11 linker "vim" ".vimrc"
11 linker "inputrc" ".inputrc" 12 linker "inputrc" ".inputrc"
12 #originally bin-ec. Renamed to .ecos.bin for sanity when listing home 13 #originally bin-ec. Renamed to .ecos.bin for sanity when listing home
13 #and replaced . with _ for more sanity 14 #and replaced . with _ for more sanity
14 linker "bin" ".ecos_bin" 15 linker "bin" ".ecos_bin"
15 16
16 #modify cshrc 17 #modify cshrc
17 echo '[ -r "${HOME}/.tcsh_init" ] && source "${HOME}/.tcsh_init" #ECCORE_TCSH' >> "${HOME}/.cshrc" 18 echo '[ -r "${HOME}/.ecos_tcsh" ] && source "${HOME}/.ecos_tcsh" #ECCORE_TCSH' >> "${HOME}/.cshrc"
18 #modify bash_profile and bashrc 19 #modify bash_profile and bashrc
19 echo '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' >> "${HOME}/.bash_profile" 20 echo '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' >> "${HOME}/.bash_profile"
20 echo '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' >> "${HOME}/.bashrc" 21 echo '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' >> "${HOME}/.bashrc"
22 #modify zshrc
23 echo '[ -r "${HOME}/.ecos_zsh" ] && . "${HOME}/.ecos_zsh" #ECCORE_ZSH' >> "${HOME}/.zshrc"
21 } 24 }
22 25
23 linker() { 26 linker() {
24 echo "Creating symlink: ${1} => ~/${2}" 27 echo "Creating symlink: ${1} => ~/${2}"
25 ln -fs "${PWD}/${1}" "${HOME}/${2}" 28 ln -fs "${PWD}/${1}" "${HOME}/${2}"
31 mv .cleancshrc "${HOME}/.cshrc" 34 mv .cleancshrc "${HOME}/.cshrc"
32 fi 35 fi
33 } 36 }
34 37
35 uninstall() { 38 uninstall() {
36 for i in .tcsh_init .tmux.conf .hgrc .vimrc .inputrc bin-ec .ecos.bin; do 39 for i in .ecos_tcsh .tmux.conf .hgrc .vimrc .inputrc bin-ec .ecos.bin .ecos_bin .ecos_bash .ecos_zsh; do
37 if [ -f "${HOME}/${i}" ]; then 40 if [ -f "${HOME}/${i}" ]; then
38 echo "Removing file: ~/${i}" 41 echo "Removing file: ~/${i}"
39 rm -f "${HOME}/${i}" 42 rm -f "${HOME}/${i}"
40 fi 43 fi
41 done 44 done
42 uninstall_tcsh 45 uninstall_tcsh
43 } 46 }
44 47
45 update() { 48 update() {
46 if [ -f "${HOME}/.tcsh_exec" ]; then 49 if [ -f "${HOME}/.tcsh_exec" ]; then
47 mv -f "${HOME}/.tcsh_exec" "${HOME}/.tcsh_init.after" 50 mv -f "${HOME}/.tcsh_exec" "${HOME}/.ecos_tcsh.after"
48 echo "Moved: ${HOME}/.tcsh_exec => ${HOME}/.tcsh_init.after" 51 echo "Moved: ${HOME}/.tcsh_exec => ${HOME}/.ecos_tcsh.after"
49 fi 52 fi
50 } 53 }
51 54
52 help() { 55 help() {
53 cat <<EOF 56 cat <<EOF