diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-12-12 11:52:34 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-12-12 11:52:34 -0500 |
commit | 28e2695a19f7babf35d177367840a82b798beb55 (patch) | |
tree | 591b2badd77a7c9c0c36b8e09abdb6a323513307 /src/StardewModdingAPI/unix-launcher.sh | |
parent | aaf354761f18a18b0bcb81c9bd32819bb28deac9 (diff) | |
parent | a3376e2a6257c01c52a3c64c4f5f1f8de9a9c906 (diff) | |
download | SMAPI-28e2695a19f7babf35d177367840a82b798beb55.tar.gz SMAPI-28e2695a19f7babf35d177367840a82b798beb55.tar.bz2 SMAPI-28e2695a19f7babf35d177367840a82b798beb55.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI/unix-launcher.sh')
-rw-r--r-- | src/StardewModdingAPI/unix-launcher.sh | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/StardewModdingAPI/unix-launcher.sh b/src/StardewModdingAPI/unix-launcher.sh index 0bfe0d5c..93e33c78 100644 --- a/src/StardewModdingAPI/unix-launcher.sh +++ b/src/StardewModdingAPI/unix-launcher.sh @@ -1,7 +1,7 @@ #!/bin/bash # MonoKickstart Shell Script # Written by Ethan "flibitijibibo" Lee -# Modified for StardewModdingAPI by Viz +# Modified for StardewModdingAPI by Viz and Pathoschild # Move to script's directory cd "`dirname "$0"`" @@ -28,15 +28,40 @@ if [ "$UNAME" == "Darwin" ]; then ln -sf mcs.bin.osx mcs cp StardewValley.bin.osx StardewModdingAPI.bin.osx - ./StardewModdingAPI.bin.osx $@ + open -a Terminal ./StardewModdingAPI.bin.osx $@ else + # choose launcher + LAUNCHER="" if [ "$ARCH" == "x86_64" ]; then ln -sf mcs.bin.x86_64 mcs cp StardewValley.bin.x86_64 StardewModdingAPI.bin.x86_64 - ./StardewModdingAPI.bin.x86_64 $@ + LAUNCHER="./StardewModdingAPI.bin.x86_64 $@" else ln -sf mcs.bin.x86 mcs cp StardewValley.bin.x86 StardewModdingAPI.bin.x86 - ./StardewModdingAPI.bin.x86 $@ + LAUNCHER="./StardewModdingAPI.bin.x86 $@" + fi + + # get cross-distro version of POSIX command + COMMAND="" + if command -v command 2>/dev/null; then + COMMAND="command -v" + elif type type 2>/dev/null; then + COMMAND="type" + fi + + # open SMAPI in terminal + if $COMMAND x-terminal-emulator 2>/dev/null; then + x-terminal-emulator -e "$LAUNCHER" + elif $COMMAND gnome-terminal 2>/dev/null; then + gnome-terminal -e "$LAUNCHER" + elif $COMMAND xterm 2>/dev/null; then + xterm -e "$LAUNCHER" + elif $COMMAND konsole 2>/dev/null; then + konsole -e "$LAUNCHER" + elif $COMMAND terminal 2>/dev/null; then + terminal -e "$LAUNCHER" + else + $LAUNCHER fi fi |