From 8e7e9394beaa59ae3be39d76585fb03c3042692c Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Wed, 3 Jan 2024 03:56:04 +0000 Subject: [PATCH] Latest --- scripts/provision.sh | 7 +++++++ scripts/src/provision.sh.tmpl | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/scripts/provision.sh b/scripts/provision.sh index 4dc85c53..3be7a726 100644 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -631,6 +631,12 @@ initChezmoiAndPrompt() { fi } +# @description When a reboot is triggered by softwareupdate on macOS, other utilities that require +# a reboot are also installed to save on reboots. +beforeRebootDarwin() { + logg info "Ensuring macfuse is installed" && brew install --cask --no-quarantine --quiet macfuse +} + # @description Save the log of the provision process to `$HOME/.local/var/log/install.doctor/install.doctor.$(date +%s).log` and add the Chezmoi # `--force` flag if the `HEADLESS_INSTALL` variable is set to `true`. runChezmoi() { @@ -682,6 +688,7 @@ runChezmoi() { ### Handle exit codes in log if cat "$LOG_FILE" | grep 'chezmoi: exit status 140' > /dev/null; then + beforeRebootDarwin logg info "Chezmoi signalled that a reboot is necessary to apply a system update" logg info "Running softwareupdate with the reboot flag" sudo softwareupdate -i -a -R --agree-to-license && exit diff --git a/scripts/src/provision.sh.tmpl b/scripts/src/provision.sh.tmpl index 9e811418..37460e7c 100644 --- a/scripts/src/provision.sh.tmpl +++ b/scripts/src/provision.sh.tmpl @@ -323,6 +323,12 @@ initChezmoiAndPrompt() { fi } +# @description When a reboot is triggered by softwareupdate on macOS, other utilities that require +# a reboot are also installed to save on reboots. +beforeRebootDarwin() { + logg info "Ensuring macfuse is installed" && brew install --cask --no-quarantine --quiet macfuse +} + # @description Save the log of the provision process to `$HOME/.local/var/log/install.doctor/install.doctor.$(date +%s).log` and add the Chezmoi # `--force` flag if the `HEADLESS_INSTALL` variable is set to `true`. runChezmoi() { @@ -374,6 +380,7 @@ runChezmoi() { ### Handle exit codes in log if cat "$LOG_FILE" | grep 'chezmoi: exit status 140' > /dev/null; then + beforeRebootDarwin logg info "Chezmoi signalled that a reboot is necessary to apply a system update" logg info "Running softwareupdate with the reboot flag" sudo softwareupdate -i -a -R --agree-to-license && exit