From 3465d68efaf7a7bd961deab6f25aac5773ce1d97 Mon Sep 17 00:00:00 2001 From: kwindrem <58538395+kwindrem@users.noreply.github.com> Date: Sun, 27 Jun 2021 14:33:18 -0700 Subject: [PATCH] fixed manual installer bugs --- .DS_Store | Bin 6148 -> 6148 bytes .gitignore | 1 + UpdateResources | 15 ++++++++++++--- packageInstaller | 10 +++++++--- timeStamp | 2 +- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.DS_Store b/.DS_Store index 2c9968f7c1b9baad0a4fcbd44464e1e6696279f1..d67787f4c513faac5789abce217a4261d3bde00c 100644 GIT binary patch delta 106 zcmZoMXffEJ#uEGSI0FL%3xgg*IzuKyNp8N2OHxjL5>Sle#(vG8lUxovqROY>l`qIJ V3{K9^Edc6aU|SkTfuZ3?u=8O@RQVLV@&y@& U!O8i#1wcIv49o_bn^_u#0kgpxEC2ui diff --git a/.gitignore b/.gitignore index 9bea433..43322df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store +.DS_Store diff --git a/UpdateResources b/UpdateResources index a9ac172..ee63262 100755 --- a/UpdateResources +++ b/UpdateResources @@ -49,7 +49,12 @@ getFromUsb () # get archive timeStamp archiveTimeStamp=$(cat "/data/$package-$gitHubBranch/timeStamp") - if [ -z $archiveTimeStamp ]; then + if [ ! -e "$packageDir" ]; then + if $logToConsole ; then + echo "$package not yet installed" + fi + return 1 + elif [ -z $archiveTimeStamp ]; then logMessage "ERROR: No timestamp in $package archive - can't update" return 0 elif [ -z $lastUpdate ]; then @@ -87,7 +92,11 @@ getFromGitHub () # fetch archive timeStamp archiveTimeStamp=$(wget -qO - https://raw.githubusercontent.com/$gitHubUser/$package/$gitHubBranch/timeStamp) - if [ -z $archiveTimeStamp ]; then + if [ ! -e "$packageDir" ]; then + if $logToConsole ; then + echo "$package not yet installed" + fi + elif [ -z $archiveTimeStamp ]; then logMessage "ERROR: Can't access GitHub archive or no timestamp for $package - can't update" return 0 elif [ -z $lastUpdate ]; then @@ -119,7 +128,7 @@ doUpdate () local package=$1 local packageDir="/data/$package" - if [ $# > 0 ] && [ $1 == 'prompting' ]; then + if [ $# > 1 ] && [ $2 == 'prompting' ]; then installOk=true else installOk=false diff --git a/packageInstaller b/packageInstaller index f524ee5..d523114 100755 --- a/packageInstaller +++ b/packageInstaller @@ -92,6 +92,9 @@ for package in $allPackages; do yesNoPrompt "$installText $package from USB? (y/n): " if $yesResponse ; then doUpdate=true + else + echo "#### removing $packageDir" + rm -rf "$packageDir-$gitHubBranch" fi break; fi @@ -105,6 +108,9 @@ for package in $allPackages; do yesNoPrompt "$installText $package from GitHub? (y/n): " if $yesResponse ; then doUpdate=true + else + echo "#### removing $packageDir" + rm -rf "$packageDir-$gitHubBranch" fi fi fi @@ -118,10 +124,8 @@ for package in $allPackages; do updateSetupHelper=true # update the package with user interaction if it is needed to do a full install (not reinstall) else - doUpdate $package 'propmting' + doUpdate $package 'prompting' fi - else - rm -rf "$packageDir-$gitHubBranch" fi done diff --git a/timeStamp b/timeStamp index 0bec787..b526117 100644 --- a/timeStamp +++ b/timeStamp @@ -1 +1 @@ -1624665999 +1624826016