scripts: improve panic helpers (#3155)

This commit is contained in:
Georg Lauterbach 2023-03-06 10:06:50 +01:00 committed by GitHub
parent b5fc40eb7a
commit dab70709d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 53 additions and 34 deletions

View file

@ -92,13 +92,13 @@ function _replace_by_env_in_file
{
if [[ -z ${1+set} ]]
then
dms_panic__invalid_value 'first argument unset' 'utils.sh:_replace_by_env_in_file'
_dms_panic__invalid_value 'first argument unset' 'utils.sh:_replace_by_env_in_file' 'immediate'
elif [[ -z ${2+set} ]]
then
dms_panic__invalid_value 'second argument unset' 'utils.sh:_replace_by_env_in_file'
_dms_panic__invalid_value 'second argument unset' 'utils.sh:_replace_by_env_in_file' 'immediate'
elif [[ ! -f ${2} ]]
then
dms_panic__invalid_value "file '${2}' does not exist" 'utils.sh:_replace_by_env_in_file'
_dms_panic__invalid_value "file '${2}' does not exist" 'utils.sh:_replace_by_env_in_file' 'immediate'
fi
local ENV_PREFIX=${1} CONFIG_FILE=${2}