From 6c5d007cc9ee29a401a53a4c3445d36b84b975ac Mon Sep 17 00:00:00 2001 From: Michael Steinbaugh Date: Wed, 4 Sep 2019 11:34:44 -0400 Subject: [PATCH] Improve tmp dir function for zsh --- system/include/functions/t.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/system/include/functions/t.sh b/system/include/functions/t.sh index 854a92e2e2..ee6879a3cb 100644 --- a/system/include/functions/t.sh +++ b/system/include/functions/t.sh @@ -4,12 +4,15 @@ # Create temporary directory. -# # Note: macOS requires `env LC_CTYPE=C`. +# +# Note: macOS requires `env LC_CTYPE=C`. # Otherwise, you'll see this error: `tr: Illegal byte sequence`. # This doesn't seem to work reliably, so using timestamp instead. -# # See also: +# +# See also: # - https://gist.github.com/earthgecko/3089509 -# # Updated 2019-06-27. +# +# Updated 2019-09-04. _koopa_tmp_dir() { local unique local dir @@ -17,9 +20,10 @@ _koopa_tmp_dir() { unique="$(date "+%Y%m%d-%H%M%S")" dir="/tmp/koopa-$(id -u)-${unique}" - mkdir -p "$dir" - chown "$USER" "$dir" - chmod 0775 "$dir" + # This doesn't work well with zsh. + # > mkdir -p "$dir" + # > chown "$USER" "$dir" + # > chmod 0775 "$dir" echo "$dir" }