do not assert missing files. git will create them in <clone>

This commit is contained in:
Gerhard Hoffmann 2023-03-30 13:40:53 +02:00
parent f080f34bb3
commit 52271bef21

View File

@ -82,23 +82,23 @@ if [ "${general_utils_sourced:-1}" = "1" ]; then # include only once
} }
assert_s () { assert_s () {
if [ -z ${!1} ]; then # if [ -z ${!1} ]; then
log_fatal "$1 not set" # log_fatal "$1 not set"
fi # fi
log_debug "$1=${!1}" log_debug "$1=${!1}"
} }
assert_d () { assert_d () {
if [ ! -d ${!1} ]; then # if [ ! -d ${!1} ]; then
log_fatal "$1 does not exist" # log_fatal "$1 does not exist"
fi # fi
log_debug "$1=${!1}" log_debug "$1=${!1}"
} }
assert_f () { assert_f () {
if [ ! -f ${!1} ]; then # if [ ! -f ${!1} ]; then
log_fatal "$1 does not exist" # log_fatal "$1 does not exist"
fi # fi
log_debug "$1=${!1}" log_debug "$1=${!1}"
} }
@ -106,9 +106,9 @@ if [ "${general_utils_sourced:-1}" = "1" ]; then # include only once
local readonly __m="${1}[@]" local readonly __m="${1}[@]"
local readonly __n=(${!__m}) local readonly __n=(${!__m})
local __len=${#__n[@]} local __len=${#__n[@]}
if [ $__len -eq 0 ]; then # if [ $__len -eq 0 ]; then
log_fatal "$1 not set" # log_fatal "$1 not set"
fi # fi
log_debug "$1=$__n" log_debug "$1=$__n"
} }
fi fi