Fix misleading error when _FILE secret is not readable.

This commit is contained in:
kon-foo authored and GitHub committed 2026-02-18 12:10:23 +05:30
1 parent 50f78bf210
commit b15f15960f
1 file changed
+4
+4
View File
@@ -23,6 +23,10 @@ function file_env() {
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ] && [ ! -r "${!fileVar}" ]; then
printf >&2 'error: %s is set to "%s" but the file does not exist or is not readable\n' \
"$fileVar" "${!fileVar}"
exit 1
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi