From 8816b8702a2ea9f5d05082144b285edd03b859d3 Mon Sep 17 00:00:00 2001 From: zjp Date: Thu, 26 Dec 2024 15:17:56 +0800 Subject: [PATCH] fix: $? should work on grep rather than popd --- tests/batch.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/batch.sh b/tests/batch.sh index 1831b92..f296d4c 100755 --- a/tests/batch.sh +++ b/tests/batch.sh @@ -26,9 +26,6 @@ find support -type f -name "Cargo.toml" | while read -r cargo_file; do $cmd 2>&1 | tee $cur/rap.txt | ansi2txt | grep 'RAP|WARN|' && echo -e "\033[32m$project_dir pass\033[0m" fi - # 返回原始目录 - popd >/dev/null - if [ $? -ne 0 ]; then echo -e "Error: '$cmd' doesn't emit WARN diagnostics in $project_dir \nRAP output:" cat $cur/rap.txt @@ -42,4 +39,6 @@ find support -type f -name "Cargo.toml" | while read -r cargo_file; do exit 1 fi + # 返回原始目录 + popd >/dev/null done