Skip to content

Commit

Permalink
Fix: don't try to copy non-existing files
Browse files Browse the repository at this point in the history
This warning was printed when creating new encrypted file
  • Loading branch information
jankaifer committed Oct 16, 2023
1 parent daf42cb commit 5687ab8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkgs/agenix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ function edit {

decrypt "$FILE" "$KEYS" || exit 1

cp "$CLEARTEXT_FILE" "$CLEARTEXT_FILE.before"
if [ -f "$CLEARTEXT_FILE" ]
then
cp "$CLEARTEXT_FILE" "$CLEARTEXT_FILE.before"
fi

[ -t 0 ] || EDITOR='cp /dev/stdin'

Expand Down

0 comments on commit 5687ab8

Please sign in to comment.