improve updater

pull/61/head
Botspot 5 years ago
parent fac0b3d69d
commit 86011ec9e4

@ -158,6 +158,8 @@ button=$? #get exit code to determine which button was pressed
echo "Button: ${button}" echo "Button: ${button}"
[ ! "$button" -eq 0 ] && error 'User cancelled' #exit now if anything but Update was clicked [ ! "$button" -eq 0 ] && error 'User cancelled' #exit now if anything but Update was clicked
PREIFS="$IFS"
IFS="|"
for i in $mainupdate for i in $mainupdate
do do
mkdir -p "$(dirname "${DIRECTORY}/${i}")" mkdir -p "$(dirname "${DIRECTORY}/${i}")"
@ -167,11 +169,11 @@ do
echo -e "\e[92m${i} was updated successfully.\e[39m" echo -e "\e[92m${i} was updated successfully.\e[39m"
done done
IFS="$PREIFS"
if [ ! -z "$updatable" ];then
x-terminal-emulator --title='Updating apps...' -e ' x-terminal-emulator --title='Updating apps...' -e '
bash -c '\'' bash -c '\''
DIRECTORY="'"$DIRECTORY"'" DIRECTORY="'"$DIRECTORY"'"
mainupdate="'"$mainupdate"'"
updatable="'"$updatable"'" updatable="'"$updatable"'"
trap "sleep 10" EXIT trap "sleep 10" EXIT
PREIFS="$IFS" PREIFS="$IFS"
@ -185,7 +187,7 @@ x-terminal-emulator --title='Updating apps...' -e '
echo -e "\e[92mAll updates complete. Closing in 10 seconds.\e[39m" echo -e "\e[92mAll updates complete. Closing in 10 seconds.\e[39m"
'\'' '\''
' '
fi
#.git folder #.git folder
#move old .git folder to trash #move old .git folder to trash
gio trash "${DIRECTORY}/.git" 2>/dev/null gio trash "${DIRECTORY}/.git" 2>/dev/null
@ -197,7 +199,8 @@ do
sleep 0.1 sleep 0.1
done done
yad --text="Please close all instances of Pi-Apps to apply the update." \ yad --text="Updates complete.
Please close all instances of Pi-Apps to apply the update." \
--text-align=center --center --title='Pi-Apps update complete' --window-icon="${DIRECTORY}/icons/logo.png" \ --text-align=center --center --title='Pi-Apps update complete' --window-icon="${DIRECTORY}/icons/logo.png" \
--button=OK!"${DIRECTORY}/icons/check.png":0 --button=OK!"${DIRECTORY}/icons/check.png":0
exit 0 exit 0

Loading…
Cancel
Save