Use sudo keepalive to ensure that we don't get a sudo timeout on a long-running install

This commit is contained in:
David Heinemeier Hansson
2026-03-15 15:19:29 +01:00
parent dc820652c1
commit fa17b5b69f
3 changed files with 15 additions and 2 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
# Prompt for sudo once and keep the credential alive in the background.
# Source this script so the trap applies to the calling shell:
# source omarchy-sudo-keepalive
sudo -v
while true; do sudo -n true; sleep 60; done 2>/dev/null &
SUDO_KEEPALIVE_PID=$!
trap "kill $SUDO_KEEPALIVE_PID 2>/dev/null" EXIT