Skip to content

Commit

Permalink
fixed manual installer bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kwindrem committed Jun 27, 2021
1 parent 844d0e8 commit 3465d68
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

.DS_Store
.DS_Store
15 changes: 12 additions & 3 deletions UpdateResources
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions packageInstaller
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion timeStamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1624665999
1624826016

0 comments on commit 3465d68

Please sign in to comment.