small pixel drawing of a pufferfish dotfiles

Update pa
Jes Olson jolson@digitalocean.com
Wed, 05 Jan 2022 13:13:57 -0600
commit

46fa6d6f57eb55b4278663c288cf75eed7428785

parent

7a1bda40f50fdc5299f3342815122e0df62b3b08

1 files changed, 7 insertions(+), 4 deletions(-)

jump to
M bin/pabin/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"