Signed-off-by: nicobo <nicobo@users.noreply.github.com>
This commit is contained in:
nicobo 2020-10-04 16:05:44 +02:00
parent 5e0d2b2b79
commit 622cdd6259
No known key found for this signature in database
GPG Key ID: 2581E71C5FA5285F
1 changed files with 2 additions and 2 deletions

View File

@ -27,8 +27,8 @@ file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
local varValue="`env | grep -E \"^${var}=\" | sed -E -e \"s/^${var}=//\"`"
local fileVarValue="`env | grep -E \"^${fileVar}=\" | sed -E -e \"s/^${fileVar}=//\"`"
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1