Detach install.sh's app relaunch so it survives byre's restart
This commit is contained in:
+9
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user