Skip to content

Commit

Permalink
only backup cleartext file if it exists
Browse files Browse the repository at this point in the history
Avoids complaints from `cp` about nonexistent files.
  • Loading branch information
shivak authored and ryantm committed Nov 29, 2023
1 parent daf42cb commit 4c48606
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/agenix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function edit {

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

cp "$CLEARTEXT_FILE" "$CLEARTEXT_FILE.before"
[ ! -f "$CLEARTEXT_FILE" ] || cp "$CLEARTEXT_FILE" "$CLEARTEXT_FILE.before"

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

Expand Down

0 comments on commit 4c48606

Please sign in to comment.