aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2020-04-04 22:46:35 -0400
committerMitch Riedstra <mitch@riedstra.us>2020-04-04 22:46:35 -0400
commit81de7c27b3dc4195965111f3fdf24b4575152916 (patch)
treeffa86be3970743d5706552a349c766cff4857c0c /shell
parent1219df17b2ffbf0c0c03e684a30929ae9a9bbc2e (diff)
downloaddotfiles-81de7c27b3dc4195965111f3fdf24b4575152916.tar.gz
dotfiles-81de7c27b3dc4195965111f3fdf24b4575152916.tar.xz
Add a little GPG helper for creating throwaway directories
Diffstat (limited to 'shell')
-rw-r--r--shell/utils10
1 files changed, 10 insertions, 0 deletions
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
+}