summaryrefslogtreecommitdiff
path: root/archsetup
diff options
context:
space:
mode:
Diffstat (limited to 'archsetup')
-rwxr-xr-xarchsetup14
1 files changed, 12 insertions, 2 deletions
diff --git a/archsetup b/archsetup
index 66a4b87..43807c6 100755
--- a/archsetup
+++ b/archsetup
@@ -86,6 +86,7 @@ archsetup_packages="/var/log/archsetup-installed-packages.txt"
min_disk_space_gb=20
state_dir="/var/lib/archsetup/state"
+error_messages=()
### State Tracking
# Enables resuming from where the script left off if interrupted.
@@ -230,8 +231,9 @@ error () {
errors_encountered=$((errors_encountered+1))
case "$1" in
"error")
- printf "ERROR: %s failed with error code %s @ %s\n" \
- "$2" "$3" "$(date +'%T')" | tee -a "$logfile"
+ msg="$2 (error code: $3)"
+ error_messages+=("$msg")
+ printf "ERROR: %s @ %s\n" "$msg" "$(date +'%T')" | tee -a "$logfile"
return 1;
;;
*)
@@ -1396,6 +1398,14 @@ outro() {
printf "Errors encountered : %s\n" "$errors_encountered" | tee -a "$logfile"
printf "Log file location : %s\n" "$logfile"
printf "Packages installed : %s\n" "$new_packages"
+
+ if [ ${#error_messages[@]} -gt 0 ]; then
+ printf "\nError Summary:\n" | tee -a "$logfile"
+ for msg in "${error_messages[@]}"; do
+ printf " - %s\n" "$msg" | tee -a "$logfile"
+ done
+ fi
+
printf "\n"
printf "Please reboot before working with your new workstation.\n\n"