small pixel drawing of a pufferfish pa

fix edit and show for hyphen-started names

 #17 was not a complete fix, some of the commands were still broken
arĉi arcxi@dismail.de
Sat, 15 Jun 2024 19:05:35 +0200
commit

54ab0fc378ac64777b1dc6eb8034a3ca301969fe

parent

ed74b06b445906f4330061ae275b8570b6e5ed7c

1 files changed, 8 insertions(+), 8 deletions(-)

jump to
M papa

@@ -31,12 +31,12 @@ #

# Heredocs are sometimes implemented via temporary files, # however this is typically done using 'mkstemp()' which # is more secure than a leak in '/proc'. - age --encrypt -R "$recipients_file" -o "$name.age" <<-EOF || + age --encrypt -R "$recipients_file" -o "./$name.age" <<-EOF || $pass EOF die "Couldn't encrypt $name.age" - git_add_and_commit "$name.age" "add '$name'" + git_add_and_commit "./$name.age" "add '$name'" printf '%s\n' "Saved '$name' to the store." }

@@ -67,15 +67,15 @@ die "Couldn't create shared memory dir"

trap 'rm -rf "$editdir"' EXIT - age --decrypt -i "$identities_file" -o "$tmpfile" "$name.age" || + age --decrypt -i "$identities_file" -o "$tmpfile" "./$name.age" || die "Couldn't decrypt $name.age" "${EDITOR:-vi}" "$tmpfile" - age --encrypt -R "$recipients_file" -o "$name.age" "$tmpfile" || + age --encrypt -R "$recipients_file" -o "./$name.age" "$tmpfile" || die "Couldn't encrypt $name.age" - git_add_and_commit "$name.age" "edit '$name'" + git_add_and_commit "./$name.age" "edit '$name'" } pw_del() {

@@ -87,12 +87,12 @@ # entry. It's fine if this fails as it means that

# another entry also lives in the same directory. rmdir -p "./${1%/*}" 2>/dev/null || : - git_add_and_commit "$1.age" "delete '$1'" + git_add_and_commit "./$1.age" "delete '$1'" } } pw_show() { - age --decrypt -i "$identities_file" "$1.age" || + age --decrypt -i "$identities_file" "./$1.age" || die "Couldn't decrypt $1.age" }

@@ -264,7 +264,7 @@

glob "$2" '/*' && die "Category can't start with '/'" - glob "$2" '*/*' && { mkdir -p "${2%/*}" || + glob "$2" '*/*' && { mkdir -p "./${2%/*}" || die "Couldn't create category '${2%/*}'"; } # Restrict permissions of any new files to