Skip to content

Commit

Permalink
Early exit if can't read file
Browse files Browse the repository at this point in the history
  • Loading branch information
abelfodil committed Jan 21, 2021
1 parent 84ef4fa commit 5efaf08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion root/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FILE_ENV_VARS="$(env | grep '__FILE=')"
for env_var in $FILE_ENV_VARS; do
var_name="$(echo $env_var | grep -o '.*__FILE=' | sed 's/__FILE=//g')"
file_path="$(echo $env_var | grep -o '__FILE=.*' | sed 's/__FILE=//g')"
file_content="$(cat $file_path)"
file_content="$(cat $file_path || exit 1)"
new_var="$(echo $var_name=$file_content)"
export $(echo $new_var | xargs)
done
Expand Down

0 comments on commit 5efaf08

Please sign in to comment.