fix bogus empty-file test

This commit is contained in:
Gwenhael Le Moine 2011-04-03 11:45:21 +07:00
parent 028ea4f261
commit 15d5682714

View file

@ -33,7 +33,7 @@ mkdir -p $CWD/els
URL=$1 URL=$1
FILENAME=$(echo "$URL" | grep -o -e "[/=][A-Za-z0-9+-]*\.el" | tr -d '=' | tr -d '/') FILENAME=$(echo "$URL" | grep -o -e "[/=][A-Za-z0-9+-]*\.el" | tr -d '=' | tr -d '/')
wget --no-check-certificate -T 10 -t 3 -c "$URL" -O "$FILENAME.new" wget --no-check-certificate -T 10 -t 3 -c "$URL" -O "$FILENAME.new"
[[ "$(cat $FILENAME.new | wc -c)" > 0 ]] && mv "$FILENAME.new" "$FILENAME" [ ! -s "$FILENAME.new" ] && mv "$FILENAME.new" "$FILENAME"
[ -e "$FILENAME.new" ] && rm "$FILENAME.new" [ -e "$FILENAME.new" ] && rm "$FILENAME.new"
} }