Update bm7.sh

This commit is contained in:
汐殇 2024-01-13 23:38:17 +08:00 committed by GitHub
parent 582b71021c
commit a0e1538d48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,7 +117,10 @@ for ((i = 0; i < ${#list[@]}; i++)); do
elif [ -f "${list[i]}/process.json" ]; then
mv ${list[i]}/process.json ${list[i]}.json
fi
if [ -f "${list[i]}.json" ]; then
if [ "$(ls ${list[i]})" = "" ]; then
sed -i '1s/^/{\n "version": 1,\n "rules": [\n {\n/g' ${list[i]}.json
elif [ -f "${list[i]}.json" ]; then
sed -i '1s/^/{\n "version": 1,\n "rules": [\n {\n/g' ${list[i]}.json
sed -i '$ s/,$/\n },\n {/g' ${list[i]}.json
cat ${list[i]}/* >> ${list[i]}.json