Skip to content

Commit

Permalink
simplified redundant creation of tmpdir
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexcrazy804 committed Nov 24, 2024
1 parent cfb1ead commit 71c1b6d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions pkgs/agenix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,8 @@ function encrypt {
fi
done <<< "$KEYS"

ENCRYPTED_DIR=$(@mktempBin@ -d)
ENCRYPTED_FILE="$ENCRYPTED_DIR/$(basename "$OUTPUT")"

ENCRYPT+=(-o "$ENCRYPTED_FILE")

ENCRYPT+=(-o "$OUTPUT")
@ageBin@ "${ENCRYPT[@]}" <"$FILE" || exit 1

mkdir -p "$(dirname "$FILE")"

mv -f "$ENCRYPTED_FILE" "$OUTPUT"
}

function rekey {
Expand Down

0 comments on commit 71c1b6d

Please sign in to comment.