mirror of
https://github.com/ryantm/agenix.git
synced 2024-09-11 06:05:38 +03:00
only backup cleartext file if it exists
Avoids complaints from `cp` about nonexistent files.
This commit is contained in:
parent
daf42cb35b
commit
4c48606094
@ -155,7 +155,7 @@ function edit {
|
|||||||
|
|
||||||
decrypt "$FILE" "$KEYS" || exit 1
|
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'
|
[ -t 0 ] || EDITOR='cp /dev/stdin'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user