#3 Validate input is file path

This commit is contained in:
Joey Hafner 2024-08-16 12:09:26 -07:00
parent afc9ef5abd
commit 0080a68f3c
No known key found for this signature in database
2 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,12 @@
# Takes file path from stdin
# Outputs to stdout
if ! [[ -f $1 ]]; then
echo "\$1 is not a file"
echo "\$1: $1"
exit 1
fi
# Set age key file path
# If no private key exists at the expected location,
# Create the key file at the expected location

View File

@ -2,6 +2,12 @@
# Takes file path from stdin
# Outputs to stdout
if ! [[ -f $1 ]]; then
echo "\$1 is not a file"
echo "\$1: $1"
exit 1
fi
# Set age directory and default recipients
AGE_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
SOPS_AGE_RECIPIENTS="$(<$AGE_DIR/.age-author-pubkeys)"