## 获取关联的头文件 all_hrl_files=$(find include -name "*.hrl") for i in${hrl_file_list[@]}; do ## for j in $(ag "$i" include/**/* | awk -F ":" '{print $1}'); do for j in $(grep "$i"$all_hrl_files | awk -F ":"'{print $1}'); do hrl_f_list="$(basename $j)$hrl_f_list" done done
## 获取变化的erl文件 erl_file_list="\"src/main.erl\"" for i in $(find . -newer time_file -regex .*.erl); do erl_file_list="$erl_file_list,\"${i/.\//}\"" done
## 获取关联的erl文件 all_files=$(find . -name "*.erl") for i in${hrl_f_list[@]}; do ## ## why??? php_ssh call fail ## ## for j in $(ag --ignore "robot" "$i" **/* | awk -F ":" '{print $1}' | grep ".erl"); do ## erl_file_list="$erl_file_list,\"$j\"" ## done for j in $(grep "$i"$all_files | awk -F ":"'{print $1}' | grep -v "/robot/"); do erl_file_list="$erl_file_list,\"${j/.\//}\"" done done
## 使用`mmake:files/2`编译 ${ERL} -pa ${SERVER_EBIN} -pa ${SERVER_BASEEBIN} -noshell -eval"case mmake:files(500,[$erl_file_list]) of up_to_date -> init:stop(); _ -> init:stop(1) end" if [[ "$?" == "0" ]]; then touch time_file fi }