|
5 | 5 | # This script is supposed to be run either on the command line |
6 | 6 | # or though the appimageupdate GUI. The GUI is purely optional. |
7 | 7 | # It displays stdout and stderr, as well as a progress indicator. |
| 8 | +# Communication between this script and the GUI happen through |
| 9 | +# file descriptors (&1 = stdout, &2 = stderr, $3 ... up to &9) |
| 10 | +# http://stackoverflow.com/questions/2342826/how-to-pipe-stderr-and-not-stdout |
| 11 | +# |
| 12 | +# echo "######" | tee >(sed -e 's/#/#\n/g' >&1) |
8 | 13 |
|
9 | 14 | error() |
10 | 15 | { |
@@ -129,7 +134,7 @@ if [ "$TYPE" == "zsync" ] ; then |
129 | 134 | # .part appended, so it will automatically find previously interrupted zsync |
130 | 135 | # downloads and reuse the data already downloaded. |
131 | 136 | ZSYNC_URL=$(echo "${APPLICATION_USED}" | cut -d "|" -f 2) # Get the URL of the zsync file |
132 | | - zsync_curl -# -I -i "${ISO}" "${ZSYNC_URL}" # Get the file with zsync using $1 as an input 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 |
133 | 138 | NEWFILE=$(basename "${ZSYNC_URL}" | sed -e 's|.zsync||g' ) # FIXME: Use the file that zsync has written!!! |
134 | 139 | chmod --reference="${ISO}" "${NEWFILE}"* # Set the same permissions as for the original file |
135 | 140 | gpg_check |
@@ -158,7 +163,7 @@ elif [ "$TYPE" == "bintray-zsync" ] ; then |
158 | 163 | echo "Latest version: ${VERSION}" |
159 | 164 | fi |
160 | 165 | ZSYNC_URL=$(echo "${DUMMY_URL}" | sed -e "s|_latestVersion|$VERSION|g" ) |
161 | | - zsync_curl -I -i "${ISO}" "${ZSYNC_URL}" # Get the file with zsync using $1 as an input file |
| 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 |
162 | 167 | NEWFILE=$(basename "${ZSYNC_URL}" | sed -e 's|.zsync||g' ) # FIXME: Use the file that zsync has written!!! |
163 | 168 | chmod --reference="${ISO}" "${NEWFILE}"* # Set the same permissions as for the original file |
164 | 169 | gpg_check |
|
0 commit comments