From ea4307a282468c20c27c6b8c2722bd46f6d5c64d Mon Sep 17 00:00:00 2001
From: Ishan Jalan <44338423+ishanjalan@users.noreply.github.com>
Date: Wed, 20 Jul 2022 22:30:09 +0530
Subject: Update unix-launcher.sh
This will open the default shell. Works for me after testing.
---
src/SMAPI.Installer/assets/unix-launcher.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'src/SMAPI.Installer/assets')
diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh
index ae9624e7..cff21bb0 100644
--- a/src/SMAPI.Installer/assets/unix-launcher.sh
+++ b/src/SMAPI.Installer/assets/unix-launcher.sh
@@ -58,7 +58,7 @@ if [ "$(uname)" == "Darwin" ]; then
echo "\"$0\" $@ --use-current-shell" >> /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
+ open -W /tmp/open-smapi-terminal.sh
rm /tmp/open-smapi-terminal.sh
exit 0
fi
--
cgit
From a50a730886e2649472011e5c0eca5113b3774555 Mon Sep 17 00:00:00 2001
From: Ishan Jalan <44338423+ishanjalan@users.noreply.github.com>
Date: Sun, 24 Jul 2022 12:01:34 +0530
Subject: unix-launcher.sh optimisations
I ran the file through Rider which used Intellisense(?) to suggest changes in addition to moving from .sh to .command
---
src/SMAPI.Installer/assets/unix-launcher.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'src/SMAPI.Installer/assets')
diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh
index cff21bb0..b9d468a0 100644
--- a/src/SMAPI.Installer/assets/unix-launcher.sh
+++ b/src/SMAPI.Installer/assets/unix-launcher.sh
@@ -54,12 +54,12 @@ if [ "$(uname)" == "Darwin" ]; then
# https://stackoverflow.com/a/29511052/262123
if [ "$USE_CURRENT_SHELL" == "false" ]; then
echo "Reopening in the Terminal app..."
- echo '#!/bin/sh' > /tmp/open-smapi-terminal.sh
- echo "\"$0\" $@ --use-current-shell" >> /tmp/open-smapi-terminal.sh
- chmod +x /tmp/open-smapi-terminal.sh
- cat /tmp/open-smapi-terminal.sh
- open -W /tmp/open-smapi-terminal.sh
- rm /tmp/open-smapi-terminal.sh
+ echo '#!/bin/sh' > /tmp/open-smapi-terminal.command
+ echo "\"$0\" $@ --use-current-shell" >> /tmp/open-smapi-terminal.command
+ chmod +x /tmp/open-smapi-terminal.command
+ cat /tmp/open-smapi-terminal.command
+ open -W /tmp/open-smapi-terminal.command
+ rm /tmp/open-smapi-terminal.command
exit 0
fi
fi
--
cgit
From dd2e3e9d933c69aba2a11815191046903c7fa5ee Mon Sep 17 00:00:00 2001
From: Ishan Jalan <44338423+ishanjalan@users.noreply.github.com>
Date: Sun, 24 Jul 2022 12:07:38 +0530
Subject: Jetbrains Rider suggestions
I ran the file on Rider and it had a few suggestions
---
src/SMAPI.Installer/assets/unix-launcher.sh | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
(limited to 'src/SMAPI.Installer/assets')
diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh
index b9d468a0..88a3a328 100644
--- a/src/SMAPI.Installer/assets/unix-launcher.sh
+++ b/src/SMAPI.Installer/assets/unix-launcher.sh
@@ -55,7 +55,7 @@ if [ "$(uname)" == "Darwin" ]; then
if [ "$USE_CURRENT_SHELL" == "false" ]; then
echo "Reopening in the Terminal app..."
echo '#!/bin/sh' > /tmp/open-smapi-terminal.command
- echo "\"$0\" $@ --use-current-shell" >> /tmp/open-smapi-terminal.command
+ echo "\"$0\" $* --use-current-shell" >> /tmp/open-smapi-terminal.command
chmod +x /tmp/open-smapi-terminal.command
cat /tmp/open-smapi-terminal.command
open -W /tmp/open-smapi-terminal.command
@@ -71,8 +71,8 @@ fi
##########
# script must be run from the game folder
if [ ! -f "Stardew Valley.dll" ]; then
- echo "Oops! SMAPI must be placed in the Stardew Valley game folder.\nSee instructions: https://stardewvalleywiki.com/Modding:Player_Guide";
- read
+ printf "Oops! SMAPI must be placed in the Stardew Valley game folder.\nSee instructions: https://stardewvalleywiki.com/Modding:Player_Guide";
+ read -r
exit 1
fi
@@ -102,37 +102,39 @@ else
# find the true shell behind x-terminal-emulator
if [ "$TERMINAL_NAME" = "x-terminal-emulator" ]; then
- export TERMINAL_NAME="$(basename "$(readlink -f $(command -v x-terminal-emulator))")"
+ TERMINAL_NAME="$(basename "$(readlink -f "$(command -v x-terminal-emulator)")")"
+ export TERMINAL_NAME
fi
# run in selected terminal and account for quirks
- export TERMINAL_PATH="$(command -v $TERMINAL_NAME)"
- if [ -x $TERMINAL_PATH ]; then
+ TERMINAL_PATH="$(command -v "$TERMINAL_NAME")"
+ export TERMINAL_PATH
+ if [ -x "$TERMINAL_PATH" ]; then
case $TERMINAL_NAME in
terminal|termite)
# consumes only one argument after -e
# options containing space characters are unsupported
- exec $TERMINAL_NAME -e "env TERM=xterm $LAUNCH_FILE $@"
+ exec "$TERMINAL_NAME" -e "env TERM=xterm $LAUNCH_FILE $*"
;;
xterm|konsole|alacritty)
# consumes all arguments after -e
- exec $TERMINAL_NAME -e env TERM=xterm $LAUNCH_FILE "$@"
+ exec "$TERMINAL_NAME" -e env TERM=xterm $LAUNCH_FILE "$*"
;;
terminator|xfce4-terminal|mate-terminal)
# consumes all arguments after -x
- exec $TERMINAL_NAME -x env TERM=xterm $LAUNCH_FILE "$@"
+ exec "$TERMINAL_NAME" -x env TERM=xterm $LAUNCH_FILE "$*"
;;
gnome-terminal)
# consumes all arguments after --
- exec $TERMINAL_NAME -- env TERM=xterm $LAUNCH_FILE "$@"
+ exec "$TERMINAL_NAME" -- env TERM=xterm $LAUNCH_FILE "$*"
;;
kitty)
# consumes all trailing arguments
- exec $TERMINAL_NAME env TERM=xterm $LAUNCH_FILE "$@"
+ exec "$TERMINAL_NAME" env TERM=xterm $LAUNCH_FILE "$*"
;;
*)
--
cgit
From ab34b6142dcd04e629012a1c30d37bc9c7e5df5e Mon Sep 17 00:00:00 2001
From: Jesse Plamondon-Willard
Date: Thu, 28 Jul 2022 21:47:21 -0400
Subject: undo $@ to $* change per discussion
---
src/SMAPI.Installer/assets/unix-launcher.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'src/SMAPI.Installer/assets')
diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh
index 88a3a328..778663d7 100644
--- a/src/SMAPI.Installer/assets/unix-launcher.sh
+++ b/src/SMAPI.Installer/assets/unix-launcher.sh
@@ -55,7 +55,7 @@ if [ "$(uname)" == "Darwin" ]; then
if [ "$USE_CURRENT_SHELL" == "false" ]; then
echo "Reopening in the Terminal app..."
echo '#!/bin/sh' > /tmp/open-smapi-terminal.command
- echo "\"$0\" $* --use-current-shell" >> /tmp/open-smapi-terminal.command
+ echo "\"$0\" $@ --use-current-shell" >> /tmp/open-smapi-terminal.command
chmod +x /tmp/open-smapi-terminal.command
cat /tmp/open-smapi-terminal.command
open -W /tmp/open-smapi-terminal.command
@@ -114,27 +114,27 @@ else
terminal|termite)
# consumes only one argument after -e
# options containing space characters are unsupported
- exec "$TERMINAL_NAME" -e "env TERM=xterm $LAUNCH_FILE $*"
+ exec "$TERMINAL_NAME" -e "env TERM=xterm $LAUNCH_FILE $@"
;;
xterm|konsole|alacritty)
# consumes all arguments after -e
- exec "$TERMINAL_NAME" -e env TERM=xterm $LAUNCH_FILE "$*"
+ exec "$TERMINAL_NAME" -e env TERM=xterm $LAUNCH_FILE "$@"
;;
terminator|xfce4-terminal|mate-terminal)
# consumes all arguments after -x
- exec "$TERMINAL_NAME" -x env TERM=xterm $LAUNCH_FILE "$*"
+ exec "$TERMINAL_NAME" -x env TERM=xterm $LAUNCH_FILE "$@"
;;
gnome-terminal)
# consumes all arguments after --
- exec "$TERMINAL_NAME" -- env TERM=xterm $LAUNCH_FILE "$*"
+ exec "$TERMINAL_NAME" -- env TERM=xterm $LAUNCH_FILE "$@"
;;
kitty)
# consumes all trailing arguments
- exec "$TERMINAL_NAME" env TERM=xterm $LAUNCH_FILE "$*"
+ exec "$TERMINAL_NAME" env TERM=xterm $LAUNCH_FILE "$@"
;;
*)
--
cgit