manage: check-all: improve stderr output

pull/953/head
Botspot 4 years ago
parent 9f76dd7f68
commit 330605ba7c

@ -307,12 +307,14 @@ elif [ "$1" == 'check-all' ];then
installedonly=1 installedonly=1
fi #end of checking for hidden flags fi #end of checking for hidden flags
echo -n "Checking for online changes... " 1>&2
#if the updater script exists in update folder, then just git pull to save time #if the updater script exists in update folder, then just git pull to save time
if [ -f "${DIRECTORY}/update/pi-apps/updater" ];then if [ -f "${DIRECTORY}/update/pi-apps/updater" ];then
cd "${DIRECTORY}/update/pi-apps" cd "${DIRECTORY}/update/pi-apps"
echo -n "The 'git pull' command says: " 1>&2 git pull || rm -rf "${DIRECTORY}/update"
git pull 1>&2 || rm -rf "${DIRECTORY}/update" fi | grep -v "Already up to date." 1>&2
fi
#re-check and if updater script does not exist then do a git clone #re-check and if updater script does not exist then do a git clone
if [ ! -f "${DIRECTORY}/update/pi-apps/updater" ];then if [ ! -f "${DIRECTORY}/update/pi-apps/updater" ];then
rm -rf "${DIRECTORY}/update" rm -rf "${DIRECTORY}/update"
@ -320,6 +322,8 @@ elif [ "$1" == 'check-all' ];then
git clone --depth=1 "$(cat "${DIRECTORY}/etc/git_url")" 1>&2|| error "failed to clone repository to the update directory!" git clone --depth=1 "$(cat "${DIRECTORY}/etc/git_url")" 1>&2|| error "failed to clone repository to the update directory!"
fi fi
echo "Done" 1>&2
if [ $installedonly == 1 ];then if [ $installedonly == 1 ];then
#installedonly flag enabled. Remove apps that are uninstalled, disabled, or corrupted #installedonly flag enabled. Remove apps that are uninstalled, disabled, or corrupted
applist="$(list_apps installed)" applist="$(list_apps installed)"
@ -334,7 +338,7 @@ elif [ "$1" == 'check-all' ];then
IFS=$'\n' IFS=$'\n'
for app in $applist for app in $applist
do do
#echo "app: $app" echo -en "Scanning apps... $app\033[0K\r" 1>&2
newhash="$(dirhash "${DIRECTORY}/update/pi-apps/apps/${app}")" #folder will not exist if local app newhash="$(dirhash "${DIRECTORY}/update/pi-apps/apps/${app}")" #folder will not exist if local app
oldhash="$(dirhash "${DIRECTORY}/apps/${app}")" #folder will not exist if new online app oldhash="$(dirhash "${DIRECTORY}/apps/${app}")" #folder will not exist if new online app
#echo -e "newhash: $newhash\noldhash: $oldhash" 1>&2 #echo -e "newhash: $newhash\noldhash: $oldhash" 1>&2
@ -373,6 +377,8 @@ ${app}"
updatable='.' updatable='.'
fi fi
echo "Done" 1>&2
echo "${updatable}" echo "${updatable}"
elif [ "$1" == 'update-all' ];then elif [ "$1" == 'update-all' ];then
#UPDATE-ALL #UPDATE-ALL

Loading…
Cancel
Save