update launch script on macOS for 1.4.5 multiplayer hotfix (#789)

Thanks to Mr. Podunkian for his help investigating this on macOS!
This commit is contained in:
Jesse Plamondon-Willard 2021-07-07 13:10:55 -04:00
parent 7b097c4f6f
commit 40a4992170
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 28 additions and 2 deletions

View File

@ -10,7 +10,7 @@
## Upcoming release ## Upcoming release
* For players: * For players:
* Improved error if SMAPI fails to dispose on game exit. * Improved error if SMAPI fails to dispose on game exit.
* Updated Linux launch script for Stardew Valley 1.4.5 multiplayer hotfix. * Updated Linux/macOS launch script for Stardew Valley 1.4.5 multiplayer hotfix.
* Fixed error when running the Windows installer as administrator (thanks to LostLogic!). * Fixed error when running the Windows installer as administrator (thanks to LostLogic!).
* Fixed `player_add` and `list_items` console commands not including some shirts _(in Console Commands)_. * Fixed `player_add` and `list_items` console commands not including some shirts _(in Console Commands)_.
* Fixed installer error on some older Windows systems (thanks to eddyballs!). * Fixed installer error on some older Windows systems (thanks to eddyballs!).

View File

@ -43,8 +43,34 @@ if [ "$UNAME" == "Darwin" ]; then
cp -p StardewValley.bin.osx StardewModdingAPI.bin.osx cp -p StardewValley.bin.osx StardewModdingAPI.bin.osx
fi fi
# Make sure we're running in Terminal (so the user can see errors/warnings/update alerts).
# Previously we would just use `open -a Terminal` to launch the .bin.osx file, but that
# doesn't let us set environment variables.
if [ ! -t 1 ]; then # https://stackoverflow.com/q/911168/262123
# sanity check to make sure we don't have an infinite loop of opening windows
SKIP_TERMINAL=false
for argument in "$@"; do
if [ "$argument" == "--no-reopen-terminal" ]; then
SKIP_TERMINAL=true
break
fi
done
# reopen in Terminal if needed
# https://stackoverflow.com/a/29511052/262123
if [ "$SKIP_TERMINAL" == "false" ]; then
echo "Reopening in the Terminal app..."
echo "\"$0\" $@ --no-reopen-terminal" > /tmp/open-smapi-terminal.sh
chmod +x /tmp/open-smapi-terminal.sh
cat /tmp/open-smapi-terminal.sh
open -W -a Terminal /tmp/open-smapi-terminal.sh
rm /tmp/open-smapi-terminal.sh
exit 0
fi
fi
# launch SMAPI # launch SMAPI
open -a Terminal ./StardewModdingAPI.bin.osx "$@" LC_ALL="C" ./StardewModdingAPI.bin.osx "$@"
else else
# choose binary file to launch # choose binary file to launch
LAUNCH_FILE="" LAUNCH_FILE=""