Update download.sh mute progress

This commit is contained in:
Jerry Ma 2022-04-02 16:13:16 +08:00 committed by GitHub
parent 0c210d088f
commit 6151fcfda0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,16 +29,16 @@ archive_find_zip=$(find cache/ -name "$1.*" | grep -E ".zip" | tail -n1)
if [ "$archive_find_tar" != "" ]; then if [ "$archive_find_tar" != "" ]; then
echo "Using cache for $1 ($archive_find_tar)" echo "Using cache for $1 ($archive_find_tar)"
tar -zxvf "$archive_find_tar" tar -zxf "$archive_find_tar"
elif [ "$archive_find_zip" != "" ]; then elif [ "$archive_find_zip" != "" ]; then
echo "Using cache for $1 ($archive_find_zip)" echo "Using cache for $1 ($archive_find_zip)"
unzip $archive_find_zip -d "$SELF_DIR/source" unzip $archive_find_zip -d "$SELF_DIR/source" > /dev/null
else else
if [ "$3" != "" ]; then if [ "$3" != "" ]; then
wget -q --show-progress "$(readconf ".$1.link$_use_backup" | sed 's/{version}/'$3'/g')" wget -q "$(readconf ".$1.link$_use_backup" | sed 's/{version}/'$3'/g')"
else else
echo "Downloading" echo "Downloading"
wget -q --show-progress "$(readconf ".$1.link$_use_backup" | sed 's/{version}/'$(readconf ".$1.version")'/g')" wget -q "$(readconf ".$1.link$_use_backup" | sed 's/{version}/'$(readconf ".$1.version")'/g')"
fi fi
if [ $? == 0 ]; then if [ $? == 0 ]; then
@ -47,7 +47,7 @@ else
if [ "$archive_file_tar" != "" ]; then if [ "$archive_file_tar" != "" ]; then
tar -zxf $archive_file_tar && mv $archive_file_tar $SELF_DIR/source/cache/$1.tgz tar -zxf $archive_file_tar && mv $archive_file_tar $SELF_DIR/source/cache/$1.tgz
elif [ "$archive_file_zip" != "" ]; then elif [ "$archive_file_zip" != "" ]; then
unzip $archive_file_zip && mv $archive_file_zip $SELF_DIR/source/cache/$1.zip unzip $archive_file_zip && mv $archive_file_zip $SELF_DIR/source/cache/$1.zip > /dev/null
else else
echo "Unable to find downloaded file, only support '.tar.gz', '.tgz', '.zip' file!" echo "Unable to find downloaded file, only support '.tar.gz', '.tgz', '.zip' file!"
exit 1 exit 1