Skip to content

Commit

Permalink
Fixes displaying the wrong variable on error in file_env
Browse files Browse the repository at this point in the history
  • Loading branch information
tlex committed Mar 27, 2022
1 parent a4895fe commit 2f46915
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ set -e
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local varName="${!var@}"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both ${varName} and ${fileVar} are set (but are mutually exclusive)"
echo >&2 "error: both ${var} and ${fileVar} are set (but are mutually exclusive)"
exit 1
fi
local val="$def"
Expand Down

0 comments on commit 2f46915

Please sign in to comment.