From 8b5190e06cd1fd76b8c86888eee729013c6971a0 Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Tue, 14 Sep 2021 11:00:05 +0800 Subject: [PATCH] Pass environment variable --- scripts/check-image.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/check-image.sh b/scripts/check-image.sh index de1a10f..638e137 100755 --- a/scripts/check-image.sh +++ b/scripts/check-image.sh @@ -4,6 +4,9 @@ set -o errexit set -o nounset set -o pipefail +DEBUG="${DEBUG:-}" +INCREMENTAL="${INCREMENTAL:-}" + declare -A DOMAIN_MAP=() for line in $(cat ./domain.txt); do @@ -58,7 +61,7 @@ for line in $(cat ./mirror.txt); do domain="${line%%/*}" new_image=$(echo "${line}" | sed "s/^${domain}/${DOMAIN_MAP["${domain}"]}/g") echo "Diff image ${line} ${new_image}" - DEBUG=true INCREMENTAL=true EXCLUDED="${exclude}" ./scripts/diff-image.sh "${line}" "${new_image}" 2>&1 | tee -a "${LOGFILE}" || { + DEBUG="${DEBUG}" INCREMENTAL="${INCREMENTAL}" EXCLUDED="${exclude}" ./scripts/diff-image.sh "${line}" "${new_image}" 2>&1 | tee -a "${LOGFILE}" || { echo "Error: diff image ${line} ${new_image}" } done