Mercurial > ec-dotfiles
changeset 533:77c1f9e624a3
Rename prefix to `.ec.` instead of `.ecos_`.
author | edogawaconan <me@myconan.net> |
---|---|
date | Tue, 25 Nov 2014 15:03:54 +0900 |
parents | d77f4aa65251 |
children | 49235ac0891a |
files | rc/bashrc rc/cshrc rc/zshrc setup |
diffstat | 4 files changed, 34 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/rc/bashrc Thu Nov 20 16:06:07 2014 +0900 +++ b/rc/bashrc Tue Nov 25 15:03:54 2014 +0900 @@ -5,13 +5,13 @@ *) return;; esac -if [ "${ECOS_BASH_LOADED}" != "yes" ]; then - ECOS_BASH_LOADED="yes" +if [ "${EC_BASH_LOADED}" != "yes" ]; then + EC_BASH_LOADED="yes" else return fi -[ -f "${HOME}/.ecos_bash.before" ] && . "${HOME}/.ecos_bash.before" +[ -f "${HOME}/.ec.bash.before" ] && . "${HOME}/.ec.bash.before" _org_path="${PATH}" @@ -240,7 +240,7 @@ esac # Priority PATHs. Always enable. -PATH="${HOME}/bin:${HOME}/.ecos_bin:/opt/local/bin:/opt/local/sbin:${PATH}" +PATH="${HOME}/bin:${HOME}/.ec.bin:/opt/local/bin:/opt/local/sbin:${PATH}" if command -v vim > /dev/null 2>&1; then alias vi=vim @@ -292,4 +292,4 @@ unset _os -[ -f "${HOME}/.ecos_bash.after" ] && . "${HOME}/.ecos_bash.after" +[ -f "${HOME}/.ec.bash.after" ] && . "${HOME}/.ec.bash.after"
--- a/rc/cshrc Thu Nov 20 16:06:07 2014 +0900 +++ b/rc/cshrc Tue Nov 25 15:03:54 2014 +0900 @@ -11,18 +11,18 @@ endif # Ensures we're not loading this script again. -if ( ! $?ecos_tcsh_loaded ) then - set ecos_tcsh_loaded="yes" +if ( ! $?ec_tcsh_loaded ) then + set ec_tcsh_loaded="yes" else exit endif -test -f "${HOME}/.ecos_tcsh.before" && source "${HOME}/.ecos_tcsh.before" +test -f "${HOME}/.ec.tcsh.before" && source "${HOME}/.ec.tcsh.before" umask 22 limit coredumpsize 0 set prompt="[%B%n@%m %~%b]%# " -set path=({,/usr}/{bin,sbin} "${HOME}"/{,.ecos_}bin) +set path=({,/usr}/{bin,sbin} "${HOME}"/{,.ec.}bin) set history=1000 set savehist=1000 set nobeep @@ -117,6 +117,6 @@ ( which vim ) > /dev/null && alias vi vim && setenv EDITOR vim -test -f "${HOME}/.ecos_tcsh.after" && source "${HOME}/.ecos_tcsh.after" +test -f "${HOME}/.ec.tcsh.after" && source "${HOME}/.ec.tcsh.after" test -x "/usr/games/fortune" && "/usr/games/fortune"
--- a/rc/zshrc Thu Nov 20 16:06:07 2014 +0900 +++ b/rc/zshrc Tue Nov 25 15:03:54 2014 +0900 @@ -1,12 +1,12 @@ #!/usr/bin/env zsh -[ -f "${HOME}/.ecos_zsh.before" ] && . "${HOME}/.ecos_zsh.before" +[ -f "${HOME}/.ec.zsh.before" ] && . "${HOME}/.ec.zsh.before" case $TERM in xterm*|screen*) precmd () {print -Pn "\e]0;%n@%m: %~\a"} ;; esac PS1='[%n@%m %~]%% ' -export PATH="${HOME}/.ecos_bin:${PATH}" +export PATH="${HOME}/.ec.bin:${PATH}" HISTFILE=~/.histfile HISTSIZE=10000 SAVEHIST=10000 @@ -23,4 +23,4 @@ export PAGER='less -Rins' alias less='less -Rins' alias ls='ls -F' -[ -f "${HOME}/.ecos_zsh.after" ] && . "${HOME}/.ecos_zsh.after" +[ -f "${HOME}/.ec.zsh.after" ] && . "${HOME}/.ec.zsh.after"
--- a/setup Thu Nov 20 16:06:07 2014 +0900 +++ b/setup Tue Nov 25 15:03:54 2014 +0900 @@ -40,9 +40,9 @@ _tcsh() { case "$1" in uninstall|install) - _rc "${1}" "cshrc" ".ecos_tcsh" - _init "${1}" 'test -r "${HOME}/.ecos_tcsh" && source "${HOME}/.ecos_tcsh" #ECCORE_TCSH' ".cshrc" - _init "${1}" 'test -r "${HOME}/.ecos_tcsh" && source "${HOME}/.ecos_tcsh" #ECCORE_TCSH' ".tcshrc" + _rc "${1}" "cshrc" ".ec.tcsh" + _init "${1}" 'test -r "${HOME}/.ec.tcsh" && source "${HOME}/.ec.tcsh" #ECCORE_TCSH' ".cshrc" + _init "${1}" 'test -r "${HOME}/.ec.tcsh" && source "${HOME}/.ec.tcsh" #ECCORE_TCSH' ".tcshrc" ;; esac } @@ -50,9 +50,9 @@ _bash() { case "${1}" in uninstall|install) - _rc "${1}" "bashrc" ".ecos_bash" - _init "${1}" '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' ".bash_profile" - _init "${1}" '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' ".bashrc" + _rc "${1}" "bashrc" ".ec.bash" + _init "${1}" '[ -r "${HOME}/.ec.bash" ] && . "${HOME}/.ec.bash" #ECCORE_BASH' ".bash_profile" + _init "${1}" '[ -r "${HOME}/.ec.bash" ] && . "${HOME}/.ec.bash" #ECCORE_BASH' ".bashrc" ;; esac } @@ -69,8 +69,8 @@ _zsh() { case "${1}" in uninstall|install) - _rc "${1}" "zshrc" ".ecos_zsh" - _init "${1}" '[ -r "${HOME}/.ecos_zsh" ] && . "${HOME}/.ecos_zsh" #ECCORE_ZSH' ".zshrc" + _rc "${1}" "zshrc" ".ec.zsh" + _init "${1}" '[ -r "${HOME}/.ec.zsh" ] && . "${HOME}/.ec.zsh" #ECCORE_ZSH' ".zshrc" ;; esac } @@ -149,6 +149,17 @@ _echo ...done } +_upgrade() { + for i in bash bash.after bash.before bin tcsh tcsh.after tcsh.before zsh zsh.after zsh.before; do + src="${HOME}/.ecos_${i}" + tgt="${HOME}/.ec.${i}" + if test -h "${src}" && test ! -h "${tgt}"; then + _echo "Moving ${src} to ${tgt}" + mv -f "${src}" "${tgt}" + fi + done +} + _help() { cat <<EOF Usage: ${0} [install|uninstall] @@ -157,12 +168,13 @@ case "${1}" in install|uninstall) + _upgrade _tcsh "${1}" _bash "${1}" _ksh "${1}" _zsh "${1}" _rc "${1}" "shellinit-posix" ".ec.shellinit-posix" - _rc "${1}" "../bin" ".ecos_bin" + _rc "${1}" "../bin" ".ec.bin" _rc "${1}" "gemrc" ".gemrc" _rc "${1}" "gitconfig" ".gitconfig" _rc "${1}" "gitignore_global" ".gitignore_global"