From f8cdd5f484f1b1d0c633f6da2016713e14e4c6e7 Mon Sep 17 00:00:00 2001
From: Mary <mary@mary.zone>
Date: Wed, 17 May 2023 19:02:15 +0200
Subject: [PATCH] macos: Fix relaunch with updater when no arguments were
 provided to the emulator (#4987)

The updater still seems to be erroring when replacing installed folder under normal operations.
---
 distribution/macos/updater.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/distribution/macos/updater.sh b/distribution/macos/updater.sh
index b60ac34df..1b3224939 100755
--- a/distribution/macos/updater.sh
+++ b/distribution/macos/updater.sh
@@ -36,4 +36,9 @@ sleep 1
 # Now replace and reopen.
 rm -rf "$INSTALL_DIRECTORY"
 mv "$NEW_APP_DIRECTORY" "$INSTALL_DIRECTORY"
-open -a "$INSTALL_DIRECTORY" --args "$APP_ARGUMENTS"
+
+if [ "$#" -le 3 ]; then
+    open -a "$INSTALL_DIRECTORY"
+else
+    open -a "$INSTALL_DIRECTORY" --args "$APP_ARGUMENTS"
+fi