Skip to content

Commit

Permalink
test: set -e for batch.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
zjp-CN committed Dec 26, 2024
1 parent e4321d9 commit 2999aff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/batch.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
#该脚本在目录下为每个Cargo项目执行相同的命令直到报错

set -e

cur=$(pwd)

# 查找并编译当前目录下的所有 Rust 项目
Expand All @@ -22,7 +24,7 @@ find support -type f -name "Cargo.toml" | while read -r cargo_file; do
#脚本有参数时按照给定参数执行cargo命令
#Example: batch.sh rap -uaf
cmd="cargo rap $@"
$cmd 2>&1 | tee $cur/rap.txt # | grep 'RAP|WARN|'
$cmd 2>&1 | tee $cur/rap.txt | grep 'RAP|WARN|'
fi

if [ $? -ne 0 ]; then
Expand Down

0 comments on commit 2999aff

Please sign in to comment.