simplified redundant creation of tmpdir

This commit is contained in:
Rexiel Scarlet 2024-11-24 22:56:22 +05:30
parent cfb1ead5b0
commit 71c1b6d179

View file

@ -227,16 +227,8 @@ function encrypt {
fi fi
done <<< "$KEYS" done <<< "$KEYS"
ENCRYPTED_DIR=$(@mktempBin@ -d) ENCRYPT+=(-o "$OUTPUT")
ENCRYPTED_FILE="$ENCRYPTED_DIR/$(basename "$OUTPUT")"
ENCRYPT+=(-o "$ENCRYPTED_FILE")
@ageBin@ "${ENCRYPT[@]}" <"$FILE" || exit 1 @ageBin@ "${ENCRYPT[@]}" <"$FILE" || exit 1
mkdir -p "$(dirname "$FILE")"
mv -f "$ENCRYPTED_FILE" "$OUTPUT"
} }
function rekey { function rekey {