Skip to content

Commit

Permalink
feature: enable one-way encrypted secrets
Browse files Browse the repository at this point in the history
fixes #9
  • Loading branch information
ryantm committed Feb 22, 2023
1 parent 63e9da1 commit b720b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgs/agenix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function edit {
CLEARTEXT_DIR=$(@mktempBin@ -d)
CLEARTEXT_FILE="$CLEARTEXT_DIR/$(basename "$FILE")"

if [ -f "$FILE" ]
if [ -f "$FILE" ] && [ -t 0 ]
then
DECRYPT=("${DEFAULT_DECRYPT[@]}")
if [[ "${DECRYPT[*]}" != *"--identity"* ]]; then
Expand Down Expand Up @@ -142,7 +142,7 @@ function edit {
warn "$FILE wasn't created."
return
fi
[ -f "$FILE" ] && [ "$EDITOR" != ":" ] && @diffBin@ -q "$CLEARTEXT_FILE.before" "$CLEARTEXT_FILE" && warn "$FILE wasn't changed, skipping re-encryption." && return
[ -f "$FILE" ] && [ "$EDITOR" != ":" ] && [ -f "$CLEARTEXT_FILE.before" ] && @diffBin@ -q "$CLEARTEXT_FILE.before" "$CLEARTEXT_FILE" && warn "$FILE wasn't changed, skipping re-encryption." && return

ENCRYPT=()
while IFS= read -r key
Expand Down

0 comments on commit b720b35

Please sign in to comment.