Detach install.sh's app relaunch so it survives byre's restart

This commit is contained in:
Ian Gulliver
2026-10-23 13:23:08 -07:00
parent 3c2932c8fb
commit 1caa2c98f0
2 changed files with 11 additions and 7 deletions
+9 -5
View File
@@ -12,9 +12,13 @@ plutil -extract CFBundleVersion raw /Applications/Byre.app/Contents/Info.plist
plutil -extract ByreCommit raw /Applications/Byre.app/Contents/Info.plist
app='^/Applications/Byre.app/Contents/MacOS/Byre$'
if pgrep -q -a -f "$app"; then
osascript -e 'tell application id "run.fc.byre.mac" to quit'
while pgrep -q -a -f "$app"; do
sleep 0.2
done
open /Applications/Byre.app
# Job control puts the relaunch in its own process group, out of reach when byre kills this script's group on restart.
set -m
(
osascript -e 'tell application id "run.fc.byre.mac" to quit'
while pgrep -q -a -f "$app"; do
sleep 0.2
done
open /Applications/Byre.app
) </dev/null >/dev/null 2>&1 &
fi