Skip to content

Commit 7ed0731

Browse files
committed
fix: always run postinstall app open as logged-in user
1 parent f3468db commit 7ed0731

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkgbuild/scripts/postinstall

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ spctl -avvv "/Applications/Coder Desktop.app/Contents/Library/SystemExtensions/c
3232
# Restart Coder Desktop if it was running before
3333
if [ -f "$RUNNING_MARKER_FILE" ]; then
3434
echo "Starting Coder Desktop..."
35-
open -a "Coder Desktop"
35+
currentUser=$(/usr/bin/stat -f "%Su" /dev/console);
36+
/bin/launchctl asuser $(/usr/bin/id -u "$currentUser") /usr/bin/open "/Applications/Coder Desktop.app"
3637
rm "$RUNNING_MARKER_FILE"
3738
echo "Coder Desktop started."
3839
fi

0 commit comments

Comments
 (0)