From b5772a969765797750bdfffc6c1469944cbaaa7c Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Thu, 5 Sep 2019 19:07:54 +0800 Subject: [PATCH] quite mode by default --- scripts/verify-links.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/verify-links.sh b/scripts/verify-links.sh index 1dd63d126feb..3025067c9a4d 100755 --- a/scripts/verify-links.sh +++ b/scripts/verify-links.sh @@ -19,6 +19,7 @@ if ! which markdown-link-check &>/dev/null; then sudo npm install -g markdown-link-check@3.7.3 fi +VERBOSE=${VERBOSE:-} CONFIG_TMP=$(mktemp) ERROR_REPORT=$(mktemp) @@ -49,17 +50,20 @@ for d in dev $(ls -d v[0-9]*); do -e "s##$ROOT#g" \ -e "s##$ROOT#g" \ scripts/markdown-link-check.tpl > $CONFIG_TMP - cat $CONFIG_TMP + if [ -n "$VERBOSE" ]; then + cat $CONFIG_TMP + fi # TODO simplify this if markdown-link-check can process multiple files together while read -r tasks; do for task in $tasks; do ( - echo markdown-link-check --config "$CONFIG_TMP" "$task" -q output=$(markdown-link-check --color --config "$CONFIG_TMP" "$task" -q) if [ $? -ne 0 ]; then printf "$output" >> $ERROR_REPORT fi - echo "$output" + if [ -n "$VERBOSE" ]; then + echo "$output" + fi ) & done wait