diff bin/moefetch @ 300:4879900244f7

Awesomely incorrect logic.
author Edho Arief <edho@myconan.net>
date Thu, 09 Feb 2012 08:59:30 +0700
parents d5ac851f3225
children 36bc27bb32ff
line wrap: on
line diff
--- a/bin/moefetch	Thu Feb 09 08:47:47 2012 +0700
+++ b/bin/moefetch	Thu Feb 09 08:59:30 2012 +0700
@@ -166,7 +166,7 @@
 			numfiles=$((numfiles + 1))
 		fi
 	done
-	echo $((numfiles - 2))
+	echo $((numfiles))
 }
 
 # check tools availability
@@ -215,13 +215,15 @@
 	fi
 	for trash in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"*
 	do
-		is_trash=
-		if [ -d "${trash}" ] || [ -n "$(is_not_md5 "${trash}")" ] || [ -z "$(grep "$(get_basename "${trash}")" "${TEMP_PREFIX}-list")" ]; then
-			is_trash=1
-			has_trash=1
-			mv -f -- "${trash}" "${trash_dir}" || Err_Impossible
-			trashes="${trashes}
+		if [ -e "${trash}" ]; then
+			is_trash=
+			if [ -d "${trash}" ] || [ -n "$(is_not_md5 "${trash}")" ] || [ -z "$(grep "$(get_basename "${trash}")" "${TEMP_PREFIX}-list")" ]; then
+				is_trash=1
+				has_trash=1
+				mv -f -- "${trash}" "${trash_dir}" || Err_Impossible
+				trashes="${trashes}
   $(get_basename "${trash}")"
+			fi
 		fi
 		progress_anim
 	done