adds function to locate sops config

ADP-216_sops_automation
LeeW 10 months ago
parent 2662a25977
commit d07f106c67

@ -103,8 +103,11 @@ function fn_sops_locate_config_in_git_repo(){
search_dir="${start_dir}" search_dir="${start_dir}"
contender="${search_dir}/.sops.yaml" contender="${search_dir}/.sops.yaml"
# base case - located the file OR stopping condition - at top of repo # base case - located the file OR stopping condition - at top of repo
if [[ -e "${contender}" ]] || [[ "${search_dir}" == "${stop_dir}" ]]; then if [[ -e "${contender}" ]]; then
>&2 echo "# BASE CASE" >&2 echo "# BASE CASE: found ${contender}"
echo "${contender}"
elif [[ "${search_dir}" == "${stop_dir}" ]]; then
>&2 echo "# STOPPING CONDITION: no sops config found, suggesting: ${contender}"
echo "${contender}" echo "${contender}"
else else
>&2 echo "# walk up one dir..." >&2 echo "# walk up one dir..."

Loading…
Cancel
Save