Skip to content

Commit

Permalink
strap-after-setup: avoid sudo unless necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Sep 6, 2024
1 parent 2b8928e commit 384ef3e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions script/strap-after-setup
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# Run by Strap after installing Brewfile dependencies

cd $(dirname $0)/..
cd "$(dirname "$0")/.." || exit

# Close terminal windows on successful exit code
/usr/libexec/PlistBuddy ~/Library/Preferences/com.apple.Terminal.plist -c \
Expand All @@ -20,4 +20,6 @@ fi
bin/touchid-enable-pam-sudo

# Ensure auto-update is always enabled
sudo defaults write /Library/Preferences/com.apple.commerce.plist AutoUpdate 1
if [ "$(defaults read /Library/Preferences/com.apple.commerce.plist AutoUpdate)" != "1" ]; then
sudo defaults write /Library/Preferences/com.apple.commerce.plist AutoUpdate 1
fi

0 comments on commit 384ef3e

Please sign in to comment.