From 2d4ec254563cd91fa3dc3825f59dd440ab536b7d Mon Sep 17 00:00:00 2001 From: zjp Date: Sun, 5 Jan 2025 22:29:53 +0800 Subject: [PATCH] chore(batch.sh): report error in red; continue in loop if cargo clean --- tests/batch.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/batch.sh b/tests/batch.sh index f296d4c..db1ba2a 100755 --- a/tests/batch.sh +++ b/tests/batch.sh @@ -21,13 +21,16 @@ find support -type f -name "Cargo.toml" | while read -r cargo_file; do #Example: batch.sh cmd="cargo clean" $cmd + # 返回原始目录 + popd >/dev/null + continue else cmd="cargo rap $@" $cmd 2>&1 | tee $cur/rap.txt | ansi2txt | grep 'RAP|WARN|' && echo -e "\033[32m$project_dir pass\033[0m" fi if [ $? -ne 0 ]; then - echo -e "Error: '$cmd' doesn't emit WARN diagnostics in $project_dir \nRAP output:" + echo -e "\033[31mError: '$cmd' doesn't emit WARN diagnostics in $project_dir \033[0m\nRAP output:" cat $cur/rap.txt exit 1 fi