about summary refs log tree commit diff stats
path: root/src/launch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/launch.sh')
-rw-r--r--src/launch.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/launch.sh b/src/launch.sh
index 467bd26..1bec502 100644
--- a/src/launch.sh
+++ b/src/launch.sh
@@ -5,7 +5,8 @@ EXIT_STATUS=0
 TMPDIR=${TMPDIR:-/tmp}
 
 failed() {
-	zenity --error --text="The program appears to not have closed correctly. Please check output.log to see details."
+	ERROR_TEXT="The program appears to not have closed correctly. Please check output.log to see details."
+	zenity --error --text="$ERROR_TEXT" || echo "$ERROR_TEXT"
 	EXIT_STATUS=1
 }
 
@@ -13,12 +14,13 @@ run_game() {
 	PAYLOAD_LINE="$(awk '/^__PAYLOAD_BEGINS__/ { print NR + 1; exit 0; }' "$0")" || return 1
 	tail -n +"${PAYLOAD_LINE}" "$0" | xz -d > "$TMPFILE" || return 1
 	chmod +x "$TMPFILE" || return 1
-	DYLD_LIBRARY_PATH=libs/ LD_LIBARY_PATH=libs/ "$TMPFILE" > output.log 2>&1 || return 1
+	DYLD_LIBRARY_PATH=libs/ LD_LIBRARY_PATH=libs/ "$TMPFILE" > output.log 2>&1 || return 1
 	return 0
 }
 
 cd "$(dirname "$0")" || exit 1
-trap '{ rm -rf "$TMPFILE"; }' EXIT
+trap '{ rm -rf "$TMPFILE"; }' EXIT HUP INT QUIT TERM PWR
+
 if ! TMPFILE="./$(mktemp .Pong-XXXXXX)";
 then
 	echo "Can't extract Pong binary to current directory. Trying $TMPDIR"