Skip to content

Commit 689ac1c

Browse files
committed
Drive progress to 100% when zsync is done
1 parent d9b5dfb commit 689ac1c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

AppImageUpdate.AppDir/usr/bin/appimageupdate

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ error()
2525
exit 1
2626
}
2727

28+
finished()
29+
{
30+
echo "#########################" | tee >(sed -e 's/#/#\n/g')
31+
}
32+
2833
# A simple dependency check
2934
which zsync_curl >/dev/null || error "zsync_curl is missing"
3035
which curl >/dev/null || error "curl is missing"
@@ -134,7 +139,8 @@ if [ "$TYPE" == "zsync" ] ; then
134139
# .part appended, so it will automatically find previously interrupted zsync
135140
# downloads and reuse the data already downloaded.
136141
ZSYNC_URL=$(echo "${APPLICATION_USED}" | cut -d "|" -f 2) # Get the URL of the zsync file
137-
zsync_curl -# -I -i "${ISO}" "${ZSYNC_URL}" 2>&1 | tee >(sed -e 's/#/#\n/g') # Get the file with zsync using $1 as an input file
142+
# Get the file with zsync using $1 as an input file
143+
zsync_curl -# -I -i "${ISO}" "${ZSYNC_URL}" 2>&1 | tee >(sed -e 's/#/#\n/g') && finished
138144
NEWFILE=$(basename "${ZSYNC_URL}" | sed -e 's|.zsync||g' ) # FIXME: Use the file that zsync has written!!!
139145
chmod --reference="${ISO}" "${NEWFILE}"* # Set the same permissions as for the original file
140146
gpg_check
@@ -163,7 +169,8 @@ elif [ "$TYPE" == "bintray-zsync" ] ; then
163169
echo "Latest version: ${VERSION}"
164170
fi
165171
ZSYNC_URL=$(echo "${DUMMY_URL}" | sed -e "s|_latestVersion|$VERSION|g" )
166-
zsync_curl -I -i "${ISO}" "${ZSYNC_URL}" 2>&1 | tee >(sed -e 's/#/#\n/g') # Get the file with zsync using $1 as an input file
172+
# Get the file with zsync using $1 as an input file
173+
zsync_curl -I -i "${ISO}" "${ZSYNC_URL}" 2>&1 | tee >(sed -e 's/#/#\n/g') && finished
167174
NEWFILE=$(basename "${ZSYNC_URL}" | sed -e 's|.zsync||g' ) # FIXME: Use the file that zsync has written!!!
168175
chmod --reference="${ISO}" "${NEWFILE}"* # Set the same permissions as for the original file
169176
gpg_check

0 commit comments

Comments
 (0)