small pixel drawing of a pufferfish pa

clean git implementation slightly
Jes Olson j3s@c3f.net
Mon, 30 Sep 2024 20:18:59 -0400
commit

861d1c91e3338651848d6a14b0c658f7d5efd6b3

parent

ff521730586d5aadcfc6b507e8842f72ed377b3e

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

jump to
M papa

@@ -40,7 +40,7 @@ die "Couldn't encrypt $name.age"

printf '%s\n' "Saved '$name' to the store." - git_add_and_commit "./$name.age" "add '$name'" + $git_enabled && git_add_and_commit "./$name.age" "add '$name'" } pw_edit() {

@@ -75,7 +75,7 @@ die "Couldn't encrypt $name.age"

if $new; then printf '%s\n' "Saved '$name' to the store."; fi - git_add_and_commit "./$name.age" "edit '$name'" + $git_enabled && git_add_and_commit "./$name.age" "edit '$name'" } }

@@ -85,7 +85,7 @@ rm -f "./$name.age"

rmdir -p "$(dirname "./$name")" 2>/dev/null || : - git_add_and_commit "./$name.age" "delete '$name'" + $git_enabled && git_add_and_commit "./$name.age" "delete '$name'" } }

@@ -99,7 +99,11 @@ find . -type f -name \*.age | sed 's/..//;s/\.age$//' | sort

} git_add_and_commit() { - if $git_enabled; then git add "$1" && git commit -qm "$2"; fi + git add "$1" || + die "couldn't git add $1" + + git commit -qm "$2" || + die "couldn't git commit $2" } rand_chars() {