#3 Fix logic for creating age keyfile

This commit is contained in:
Joey Hafner 2024-08-15 16:24:21 -07:00
parent e5256cff1e
commit 766a34dfb4
No known key found for this signature in database

View File

@ -6,11 +6,12 @@
# If no private key exists at the expected location,
# Create the key file at the expected location
SOPS_AGE_KEY_FILE=$HOME/.age/key
if [[ -f $SOPS_AGE_KEY_FILE ]]; then
export SOPS_AGE_KEY_FILE=$HOME/.age/key
if [[ ! -f $SOPS_AGE_KEY_FILE ]]; then
age-keygen -o $SOPS_AGE_KEY_FILE
fi
export SOPS_AGE_KEY_FILE=$HOME/.age/key
# Set age directory and default recipients
AGE_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
SOPS_AGE_RECIPIENTS="$(<$AGE_DIR/.age-author-pubkeys)"