fix updater

pull/61/head
Botspot 4 years ago
parent ad8a83a329
commit 4fd073430a

@ -158,9 +158,13 @@ button=$? #get exit code to determine which button was pressed
echo "Button: ${button}"
[ ! "$button" -eq 0 ] && error 'User cancelled' #exit now if anything but Update was clicked
x-terminal-emulator --title="Installing $output" -e "
updatable="$(echo "$updatable" | tr '|' '!')"
mainupdate="$(echo "$mainupdate" | tr '|' '!')"
lxterminal --title="Updating Pi-Apps..." -e "
trap 'sleep 30' EXIT
PREIFS=\"$IFS\"
IFS='|'
IFS='!'
for i in $updatable
do
\"${DIRECTORY}/manage\" update \"$i\" nofetch
@ -172,17 +176,25 @@ x-terminal-emulator --title="Installing $output" -e "
#move old program to trash
gio trash \"${DIRECTORY}/${i}\" 2>/dev/null
mkdir -p \"$(dirname \"${DIRECTORY}/${i}\")\"
mkdir -p \"$(dirname "${DIRECTORY}/${i}")\"
#copy new version to apps/
cp -f \"${DIRECTORY}/update/pi-apps/${i}\" \"${DIRECTORY}/${i}\" || error \"Failed to copy ${DIRECTORY}/update/pi-apps/${i}!\"
cp -f \"${DIRECTORY}/update/pi-apps/${i}\" \"${DIRECTORY}/${i}\"
echo -e \"\e[92m${i} was updated successfully.\e[39m\"
done
IFS=\"$PREIFS\"
#move old .git folder to trash
gio trash \"${DIRECTORY}/.git\" 2>/dev/null
#copy new .git folder
cp -rf \"${DIRECTORY}/update/pi-apps/.git\" \"${DIRECTORY}/.git\"
"
#.git folder
#move old .git folder to trash
gio trash "${DIRECTORY}/.git" 2>/dev/null
cp -rf "${DIRECTORY}/update/pi-apps/.git" "${DIRECTORY}/.git" || error "Failed to copy new .git!"
sleep 1
while ps -C manage >/dev/null;do sleep 0.1; done
yad --text="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" \
--button=OK!"${DIRECTORY}/icons/check.png":0
exit 0

Loading…
Cancel
Save