Skip to content

Commit

Permalink
fix: $? should work on grep rather than popd
Browse files Browse the repository at this point in the history
  • Loading branch information
zjp-CN committed Dec 26, 2024
1 parent dadaaef commit 8816b87
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/batch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,4 +39,6 @@ find support -type f -name "Cargo.toml" | while read -r cargo_file; do
exit 1
fi

# 返回原始目录
popd >/dev/null
done

0 comments on commit 8816b87

Please sign in to comment.