Mercurial > ec-dotfiles
changeset 534:49235ac0891a
A better check?
author | edogawaconan <me@myconan.net> |
---|---|
date | Wed, 26 Nov 2014 10:45:25 +0900 |
parents | 77c1f9e624a3 |
children | 70d4fb4f7d9f |
files | setup |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/setup Tue Nov 25 15:03:54 2014 +0900 +++ b/setup Wed Nov 26 10:45:25 2014 +0900 @@ -152,10 +152,12 @@ _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}" + dst="${HOME}/.ec.${i}" + if test -f "${src}" || test -d "${src}" || test -h "${src}"; then + if test ! -f "${dst}" && test ! -d "${dst}" && test ! -h "${dst}"; then + _echo "Moving ${src} to ${dst}" + mv -f "${src}" "${dst}" + fi fi done }