comparison setup @ 533:77c1f9e624a3

Rename prefix to `.ec.` instead of `.ecos_`.
author edogawaconan <me@myconan.net>
date Tue, 25 Nov 2014 15:03:54 +0900
parents cb4e2a6595ea
children 49235ac0891a
comparison
equal deleted inserted replaced
532:d77f4aa65251 533:77c1f9e624a3
38 } 38 }
39 39
40 _tcsh() { 40 _tcsh() {
41 case "$1" in 41 case "$1" in
42 uninstall|install) 42 uninstall|install)
43 _rc "${1}" "cshrc" ".ecos_tcsh" 43 _rc "${1}" "cshrc" ".ec.tcsh"
44 _init "${1}" 'test -r "${HOME}/.ecos_tcsh" && source "${HOME}/.ecos_tcsh" #ECCORE_TCSH' ".cshrc" 44 _init "${1}" 'test -r "${HOME}/.ec.tcsh" && source "${HOME}/.ec.tcsh" #ECCORE_TCSH' ".cshrc"
45 _init "${1}" 'test -r "${HOME}/.ecos_tcsh" && source "${HOME}/.ecos_tcsh" #ECCORE_TCSH' ".tcshrc" 45 _init "${1}" 'test -r "${HOME}/.ec.tcsh" && source "${HOME}/.ec.tcsh" #ECCORE_TCSH' ".tcshrc"
46 ;; 46 ;;
47 esac 47 esac
48 } 48 }
49 49
50 _bash() { 50 _bash() {
51 case "${1}" in 51 case "${1}" in
52 uninstall|install) 52 uninstall|install)
53 _rc "${1}" "bashrc" ".ecos_bash" 53 _rc "${1}" "bashrc" ".ec.bash"
54 _init "${1}" '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' ".bash_profile" 54 _init "${1}" '[ -r "${HOME}/.ec.bash" ] && . "${HOME}/.ec.bash" #ECCORE_BASH' ".bash_profile"
55 _init "${1}" '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' ".bashrc" 55 _init "${1}" '[ -r "${HOME}/.ec.bash" ] && . "${HOME}/.ec.bash" #ECCORE_BASH' ".bashrc"
56 ;; 56 ;;
57 esac 57 esac
58 } 58 }
59 59
60 _ksh() { 60 _ksh() {
67 } 67 }
68 68
69 _zsh() { 69 _zsh() {
70 case "${1}" in 70 case "${1}" in
71 uninstall|install) 71 uninstall|install)
72 _rc "${1}" "zshrc" ".ecos_zsh" 72 _rc "${1}" "zshrc" ".ec.zsh"
73 _init "${1}" '[ -r "${HOME}/.ecos_zsh" ] && . "${HOME}/.ecos_zsh" #ECCORE_ZSH' ".zshrc" 73 _init "${1}" '[ -r "${HOME}/.ec.zsh" ] && . "${HOME}/.ec.zsh" #ECCORE_ZSH' ".zshrc"
74 ;; 74 ;;
75 esac 75 esac
76 } 76 }
77 77
78 _rc() { 78 _rc() {
147 _rc "${1}" "../vendor/vim-syntax/${syntax_file_name}" ".vim/syntax/${syntax_file_name}" > /dev/null 147 _rc "${1}" "../vendor/vim-syntax/${syntax_file_name}" ".vim/syntax/${syntax_file_name}" > /dev/null
148 done 148 done
149 _echo ...done 149 _echo ...done
150 } 150 }
151 151
152 _upgrade() {
153 for i in bash bash.after bash.before bin tcsh tcsh.after tcsh.before zsh zsh.after zsh.before; do
154 src="${HOME}/.ecos_${i}"
155 tgt="${HOME}/.ec.${i}"
156 if test -h "${src}" && test ! -h "${tgt}"; then
157 _echo "Moving ${src} to ${tgt}"
158 mv -f "${src}" "${tgt}"
159 fi
160 done
161 }
162
152 _help() { 163 _help() {
153 cat <<EOF 164 cat <<EOF
154 Usage: ${0} [install|uninstall] 165 Usage: ${0} [install|uninstall]
155 EOF 166 EOF
156 } 167 }
157 168
158 case "${1}" in 169 case "${1}" in
159 install|uninstall) 170 install|uninstall)
171 _upgrade
160 _tcsh "${1}" 172 _tcsh "${1}"
161 _bash "${1}" 173 _bash "${1}"
162 _ksh "${1}" 174 _ksh "${1}"
163 _zsh "${1}" 175 _zsh "${1}"
164 _rc "${1}" "shellinit-posix" ".ec.shellinit-posix" 176 _rc "${1}" "shellinit-posix" ".ec.shellinit-posix"
165 _rc "${1}" "../bin" ".ecos_bin" 177 _rc "${1}" "../bin" ".ec.bin"
166 _rc "${1}" "gemrc" ".gemrc" 178 _rc "${1}" "gemrc" ".gemrc"
167 _rc "${1}" "gitconfig" ".gitconfig" 179 _rc "${1}" "gitconfig" ".gitconfig"
168 _rc "${1}" "gitignore_global" ".gitignore_global" 180 _rc "${1}" "gitignore_global" ".gitignore_global"
169 _rc "${1}" "hgrc" ".hgrc" 181 _rc "${1}" "hgrc" ".hgrc"
170 _touch "${HOME}/.hgrc.local" 182 _touch "${HOME}/.hgrc.local"