changeset 153:7b07448e46f1

fix: when there is no error file
author edhoprima
date Sat, 25 Apr 2009 16:03:42 +0000
parents 67df02877319
children 8bca9dc8c20d
files moefetch.sh
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/moefetch.sh	Sat Apr 25 15:57:29 2009 +0000
+++ b/moefetch.sh	Sat Apr 25 16:03:42 2009 +0000
@@ -75,7 +75,7 @@
 		done
 		echo
 		cd ../temp
-		totalerr=`wc -l < $tags-error`
+		totalerr=`echo \`wc -l < "$outdir-error"\``
 		echo "$totalerr file(s) error"
 
 		echo "Generating list of new files..."
@@ -88,11 +88,12 @@
 		cd "../$outdir"
 
 		echo "Removing error files"
-		if [ $totalerr -gt 0 ]
-		then
+		if [ $totalerr -eq 0 ]; then
+			echo "No error file. 0 file removed"
+		elif [ $totalerr -gt 0 ]; then
 			cat "../temp/$outdir-error" | xargs rm
+		echo "$totalerr file(s) removed"
 		fi
-		echo "$totalerr file(s) removed"
 		echo "`echo \`ls | wc -l\`` file(s) available locally"
 		cd ..
 	else