Skip to content

Commit

Permalink
chore(batch.sh): report error in red; continue in loop if cargo clean
Browse files Browse the repository at this point in the history
  • Loading branch information
zjp-CN committed Jan 5, 2025
1 parent ae3e460 commit 2d4ec25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/batch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d4ec25

Please sign in to comment.