From 81de7c27b3dc4195965111f3fdf24b4575152916 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sat, 4 Apr 2020 22:46:35 -0400 Subject: Add a little GPG helper for creating throwaway directories --- shell/utils | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'shell/utils') diff --git a/shell/utils b/shell/utils index 92f7f82..955d958 100644 --- a/shell/utils +++ b/shell/utils @@ -222,3 +222,13 @@ eval _tmux_session -s "\$session" -w "\$working_directory" -n "main" \ "\$@" \ } + +gpgTmpDir() { + set -x + if echo "$GNUPGHOME" | grep -q "/dev/shm/"; then + rm -rvf "$GNUPGHOME" + fi + + export GNUPGHOME="$(mktemp -d /dev/shm/GPG.XXXXXX)" + set +x +} -- cgit v1.2.3