commit 33882eefee2a51ba780e85f94dddf597afe23142
parent 2266bf25e7ebf93876140b5c57e559490d61538e
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date: Sat, 21 Sep 2024 15:27:03 +0000
Init command is corrected
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/pashage.sh b/src/pashage.sh
@@ -747,11 +747,12 @@ do_init() {
mkdir -p -- "${SUBDIR}"
+ scm_begin
+
if ! [ -f "${TARGET}" ] || [ "${OVERWRITE}" = yes ]; then
: >|"${TARGET}"
fi
- scm_begin
printf '%s\n' "$@" >>"${TARGET}"
scm_add "${TARGET#"${PREFIX}/"}"
if ! [ "${DECISION}" = keep ]; then
@@ -884,6 +885,7 @@ do_reencrypt_file() {
unset ANSWER
fi
+ OVERWRITE=once
WIP_FILE="$(mktemp "${PREFIX}/$1-XXXXXXXXX.age")"
do_decrypt "${PREFIX}/$1.age" \
| do_encrypt "${WIP_FILE#"${PREFIX}"/}"