simplify running SMAPI without a terminal on Linux/macOS
This commit is contained in:
parent
beb1acd4f8
commit
95f658014e
|
@ -4,6 +4,7 @@
|
|||
## Upcoming release
|
||||
* For players:
|
||||
* Fixed outdated instructions in Steam error message.
|
||||
* Simplified [running without a terminal on Linux/macOS](https://stardewvalleywiki.com/Modding:Player_Guide/Troubleshooting#SMAPI_doesn.27t_recognize_controller_.28Steam_only.29) when needed.
|
||||
* Updated compatibility list.
|
||||
|
||||
* For the web UI:
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
# move to script's directory
|
||||
cd "$(dirname "$0")" || exit $?
|
||||
|
||||
# change to true to skip opening a terminal
|
||||
# This isn't recommended since you won't see errors, warnings, and update alerts.
|
||||
SKIP_TERMINAL=false
|
||||
|
||||
|
||||
##########
|
||||
## Open terminal if needed
|
||||
|
@ -16,7 +20,6 @@ cd "$(dirname "$0")" || exit $?
|
|||
if [ "$(uname)" == "Darwin" ]; then
|
||||
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
|
||||
|
@ -63,6 +66,8 @@ else
|
|||
LAUNCH_FILE="./StardewModdingAPI"
|
||||
export LAUNCH_FILE
|
||||
|
||||
# run in terminal
|
||||
if [ "$SKIP_TERMINAL" == "false" ]; then
|
||||
# select terminal (prefer xterm for best compatibility, then known supported terminals)
|
||||
for terminal in xterm gnome-terminal kitty terminator xfce4-terminal konsole terminal termite alacritty mate-terminal x-terminal-emulator; do
|
||||
if command -v "$terminal" 2>/dev/null; then
|
||||
|
@ -123,4 +128,9 @@ else
|
|||
exec $LAUNCH_FILE --no-terminal "$@"
|
||||
fi
|
||||
fi
|
||||
|
||||
# explicitly run without terminal
|
||||
else
|
||||
exec $LAUNCH_FILE --no-terminal "$@"
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue