updater: add image mimetype and say apps will be updated

pull/641/head
Botspot 3 years ago
parent 0077e55b82
commit 093958b04d

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

@ -145,19 +145,27 @@ IFS="|"
for i in $updatable
do
LIST="${LIST}${DIRECTORY}/update/pi-apps/apps/${i}/icon-24.png
$i "\("$([ $(cat "${DIRECTORY}/data/update-status/${i}") == 'new' ]&&echo 'new ')app"\)"
$i "\("$([ $(cat "${DIRECTORY}/data/update-status/${i}") == 'new' ] && echo 'new ')app$([ $(cat "${DIRECTORY}/data/status/${i}") == 'installed' ] && echo ', <b>will be reinstalled</b>')"\)"
"
done
for i in $mainupdate
do
LIST="${LIST}$(if [ "$(file -b --mime-type "${DIRECTORY}/${i}")" == 'text/x-shellscript' ];then
#if updatable file in question is a shell script, then display shellscript icon.
echo "${DIRECTORY}/icons/shellscript.png"
else
#otherwise display txt icon.
echo "${DIRECTORY}/icons/txt.png"
fi)
$i "\("file"\)"
#determine mimetype of updatable file to display an informative icon in the list
if [ "$(file -b --mime-type "${DIRECTORY}/${i}")" == 'text/x-shellscript' ];then
#if updatable file in question is a shell script, then display shellscript icon.
mimeicon="${DIRECTORY}/icons/shellscript.png"
mimetype='script'
elif [ "$(file -b --mime-type "${DIRECTORY}/${i}")" == 'image/png' ];then
mimeicon="${DIRECTORY}/icons/image.png"
mimetype='image'
else
#otherwise display txt icon.
mimeicon="${DIRECTORY}/icons/txt.png"
mimetype='file'
fi
LIST="${LIST}${mimeicon}
$i "\("$mimetype"\)"
"
done
IFS="$PREIFS"

Loading…
Cancel
Save