Update pa
Jes Olson jolson@digitalocean.com
Wed, 05 Jan 2022 13:13:57 -0600
1 files changed,
7 insertions(+),
4 deletions(-)
jump to
M
bin/pa
→
bin/pa
@@ -60,12 +60,15 @@ # and securely wipe it without worrying about
# residual badness [ -d /dev/shm ] || die "Failed to access /dev/shm" - mkdir -p /dev/shm/pa + # get base dirname in case we're dealing with + # a nested item (foo/bar) + tmpfile="/dev/shm/pa/$name.txt" + tmpdir="$(dirname $tmpfile)" + mkdir -p "$tmpdir" trap 'rm -rf /dev/shm/pa' EXIT - tmpfile="/dev/shm/pa/$name.txt" - age -i ~/.age/key.txt --decrypt "$1.age" 2>/dev/null > "$tmpfile" || - die "Could not decrypt $1.age" + age -i ~/.age/key.txt --decrypt "$name.age" 2>/dev/null > "$tmpfile" || + die "Could not decrypt $name.age" "${EDITOR:-vi}" "$tmpfile"