Skip to content

Commit 88fef17

Browse files
committed
feature: enable one-way encrypted secrets
fixes #9
1 parent 797ee44 commit 88fef17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkgs/agenix.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function decrypt {
130130
err "There is no rule for $FILE in $RULES."
131131
fi
132132

133-
if [ -f "$FILE" ]
133+
if [ -f "$FILE" ] && [ -t 0 ]
134134
then
135135
DECRYPT=("${DEFAULT_DECRYPT[@]}")
136136
if [[ "${DECRYPT[*]}" != *"--identity"* ]]; then
@@ -171,7 +171,7 @@ function edit {
171171
warn "$FILE wasn't created."
172172
return
173173
fi
174-
[ -f "$FILE" ] && [ "$EDITOR" != ":" ] && @diffBin@ -q -- "$CLEARTEXT_FILE.before" "$CLEARTEXT_FILE" && warn "$FILE wasn't changed, skipping re-encryption." && return
174+
[ -f "$FILE" ] && [ "$EDITOR" != ":" ] && [ -f "$CLEARTEXT_FILE.before" ] && @diffBin@ -q "$CLEARTEXT_FILE.before" "$CLEARTEXT_FILE" && warn "$FILE wasn't changed, skipping re-encryption." && return
175175

176176
ENCRYPT=()
177177
if [[ "$ARMOR" == "true" ]]; then

0 commit comments

Comments
 (0)