Fix: don't try to copy non-existing files

This warning was printed when creating new encrypted file
This commit is contained in:
Jan Kaifer 2023-10-16 18:16:59 +02:00
parent daf42cb35b
commit 5687ab8e3c
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -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'