Merge branch 'master-develop' of gitee.com:shenzhen-jiuyilian/ipc into master-develop
This commit is contained in:
commit
03101fd6a5
29
tools/shell/delete_test_code.sh
Executable file
29
tools/shell/delete_test_code.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
# 检查参数
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: $0 <directory>"
|
||||
echo "Example: $0 /path/to/search"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 检查目录是否存在
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "Error: Directory '$1' does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 递归遍历并删除文件
|
||||
find "$1" -type d -name "tool" | while read -r tool_dir; do
|
||||
# 在tool目录下查找src目录
|
||||
src_dir="$tool_dir/src"
|
||||
if [ -d "$src_dir" ]; then
|
||||
# 删除src目录下的所有文件
|
||||
find "$src_dir" -type f -delete
|
||||
echo "Deleted all files in '$src_dir'"
|
||||
else
|
||||
echo "No 'src' directory found in '$tool_dir'"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Operation completed."
|
Loading…
Reference in New Issue
Block a user