检测ibiu打包是否误打为debug的脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
#原理:根据上次出错经验,观察git文件变化规律,发现xxxmodule-umbrella.h文件会对打包方式进行标记。
#思路:检查umbrella文件是否包含/*Debug*/字符。
#输入:本脚本地址 空格 工程根目录。
#输出:含有debug的umbrella.h文件路径 搜索完成返回 done
#耗时:我的机器用了 1分45秒

function scandir() {
local cur_dir parent_dir workdir target_dir
workdir=$1
target_dir="-umbrella.h"
cd ${workdir}
if [ ${workdir} = "/" ]
then
cur_dir=""
else
cur_dir=$(pwd)
fi

for dirlist in $(ls ${cur_dir})
do
if test -d ${dirlist};then
cd ${dirlist}
scandir ${cur_dir}/${dirlist}
cd ..
elif [[ ${dirlist} =~ ${target_dir} ]]
then
if [ `grep -c "*Debug*" ${cur_dir}/${dirlist}` -gt '0' ]; then

#echo "Found!"
#else
#echo "Debug"
#fi
echo ${cur_dir}/${dirlist}
fi
fi
done
}

if test -d $1
then
scandir $1
echo "done"
elif test -f $1
then
echo "you input a file but not a directory,pls reinput and try again"
exit 1
else
echo "the Directory isn't exist which you input,pls input a new one!!"
exit 1
fi
Older Post

LeetCodePageTwo

350. Intersection of Two Arrays IIGiven two arrays, write a function to compute their intersection. Example:1Given nums1 = [1, 2, 2, 1], nums2 = [2, 2 …

继续阅读