From d07f106c6731cac4caf5dffad9464690b81e4f33 Mon Sep 17 00:00:00 2001 From: LeeW Date: Thu, 13 Feb 2025 15:49:08 +0100 Subject: [PATCH] adds function to locate sops config --- bin/update_sops.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/update_sops.sh b/bin/update_sops.sh index 1beaf65..cf91834 100755 --- a/bin/update_sops.sh +++ b/bin/update_sops.sh @@ -103,8 +103,11 @@ function fn_sops_locate_config_in_git_repo(){ search_dir="${start_dir}" contender="${search_dir}/.sops.yaml" # base case - located the file OR stopping condition - at top of repo - if [[ -e "${contender}" ]] || [[ "${search_dir}" == "${stop_dir}" ]]; then - >&2 echo "# BASE CASE" + if [[ -e "${contender}" ]]; then + >&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}" else >&2 echo "# walk up one dir..."