mirror of
https://github.com/wallabag/docker.git
synced 2026-02-28 04:37:34 +01:00
Early exit if can't read file
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user