|
|
|
|
@ -170,17 +170,16 @@ function main(){
|
|
|
|
|
# VALIDATE INPUTS
|
|
|
|
|
keyfiles_dir="$(realpath "${keyfiles_dir}")"
|
|
|
|
|
test -d "${keyfiles_dir}" || (echo "E: specify dir containing keyfiles; invalid dir: '${keyfiles_dir}'" && exit 1)
|
|
|
|
|
# define sops config location
|
|
|
|
|
sops_config=""
|
|
|
|
|
if [[ -n "${sops_config_dir:-}" ]]; then
|
|
|
|
|
# user-specified
|
|
|
|
|
sops_config_dir="$(realpath "${sops_config_dir}")"
|
|
|
|
|
# vvv possibly redundant, since the 'realpath' will fail if dir not valid
|
|
|
|
|
test -d "${sops_config_dir}" || (echo "E: specify dir containing .sops.yaml, invalid dir: '${sops_config_dir}'" && exit 1)
|
|
|
|
|
sops_config="${sops_config_dir}/.sops.yaml"
|
|
|
|
|
set -x
|
|
|
|
|
touch "${sops_config}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# locate appropriate sops config if default assumption not found
|
|
|
|
|
if [[ ! -e "${sops_config}" ]]; then
|
|
|
|
|
else
|
|
|
|
|
# locate appropriate sops config if default assumption not found
|
|
|
|
|
# dev note: '2> /dev/null' to disable debug output
|
|
|
|
|
sops_config="$(fn_sops_locate_config_in_git_repo 2> /dev/null)"
|
|
|
|
|
fi
|
|
|
|
|
|