From e6be305258970e72097e5ca313cab1436e830a19 Mon Sep 17 00:00:00 2001
From: Salt <rehashedsalt@cock.li>
Date: Thu, 22 Nov 2018 02:43:48 -0600
Subject: [PATCH] tmp: Code cleanup

---
 tmp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tmp b/tmp
index ff585d1..e7edb4e 100755
--- a/tmp
+++ b/tmp
@@ -14,7 +14,10 @@ tmpdir="$(mktemp -d)"
 # Define functions
 function log() {
 	[ -z ${1+x} ] && return 1
-	printf "${name}: $1\n"
+	# shellcheck disable=1117
+	printf "%b: %s\n" \
+		"$name" \
+		"$1"
 }
 function cleanup() {
 	rm -rf "${tmpdir}"
@@ -23,8 +26,8 @@ trap "cleanup" EXIT
 # Do the do
 log "This folder will be removed when this shell exits"
 (
-cd "${tmpdir}"
-$SHELL
+cd "${tmpdir}" || exit 50
+exec "$SHELL"
 )
 cleanup