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 1b90080 commit dfc3a38
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions root/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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)"
[[ ! $? -eq 0 ]] && exit 1 # Exit if last command failed
new_var="$(echo $var_name=$file_content)"
export $(echo $new_var | xargs)
done
Expand Down

0 comments on commit dfc3a38

Please sign in to comment.