|
|
|
|
@ -167,7 +167,11 @@ function main(){
|
|
|
|
|
sops_config_dir="$(realpath "${sops_config_dir}")"
|
|
|
|
|
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"
|
|
|
|
|
# create it! # test -e "${sops_config}" || (echo "E: could not locate .sops.yaml, tried ${sops_config}" && exit 1)
|
|
|
|
|
# locate appropriate sops config if default assumption not found
|
|
|
|
|
if [[ ! -e "${sops_config}" ]]; then
|
|
|
|
|
# dev note: '2> /dev/null' to disable debug output
|
|
|
|
|
sops_config="$(fn_sops_locate_config_in_git_repo 2> /dev/null)"
|
|
|
|
|
fi
|
|
|
|
|
if [[ "${#secrets_file_list[@]}" != "0" ]]; then
|
|
|
|
|
for secrets_file in "${secrets_file_list[@]}"; do
|
|
|
|
|
test -e "${secrets_file}" || (echo "E: could not locate file with secrets, tried: ${secrets_file}" && exit 1)
|
|
|
|
|
@ -187,11 +191,6 @@ function main(){
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# UPDATE SOPS CONFIG
|
|
|
|
|
# locate sops config
|
|
|
|
|
if [[ ! -e "${sops_config}" ]]; then
|
|
|
|
|
# dev note: '2> /dev/null' to disable debug output
|
|
|
|
|
sops_config="$(fn_sops_locate_config_in_git_repo 2> /dev/null)"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# update sops config
|
|
|
|
|
# TODO: remove the 'pushd;popd' workaround and make the functions aware of the dir being read
|
|
|
|
|
|