diff setup @ 534:49235ac0891a

A better check?
author edogawaconan <me@myconan.net>
date Wed, 26 Nov 2014 10:45:25 +0900
parents 77c1f9e624a3
children 138ee2cd2179
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
 }