Commit 7cf4c785 authored by nanahira's avatar nanahira

fix

parent db0d2f14
...@@ -23,10 +23,7 @@ blacklist_files["script/special.lua"]=1 ...@@ -23,10 +23,7 @@ blacklist_files["script/special.lua"]=1
blacklist_files["script/procedure.lua"]=1 blacklist_files["script/procedure.lua"]=1
loaded_count=0 loaded_count=0
sqlite3 cards.cdb 'select id from datas;' | while read -r code; do while read -r code; do
if [ -z "$code" ]; then
continue
fi
ocg_codes[$code]=1 ocg_codes[$code]=1
blacklist_files["script/c$code.lua"]=1 blacklist_files["script/c$code.lua"]=1
blacklist_files["pics/$code.jpg"]=1 blacklist_files["pics/$code.jpg"]=1
...@@ -34,7 +31,7 @@ sqlite3 cards.cdb 'select id from datas;' | while read -r code; do ...@@ -34,7 +31,7 @@ sqlite3 cards.cdb 'select id from datas;' | while read -r code; do
blacklist_files["pics/field/$code.jpg"]=1 blacklist_files["pics/field/$code.jpg"]=1
blacklist_files["pics/field/$code.png"]=1 blacklist_files["pics/field/$code.png"]=1
loaded_count=$((loaded_count + 1)) loaded_count=$((loaded_count + 1))
done done < <(sqlite3 cards.cdb 'select id from datas;')
echo "Loaded $loaded_count OCG codes" echo "Loaded $loaded_count OCG codes"
something_changed=0 something_changed=0
...@@ -85,7 +82,7 @@ process_repo() { ...@@ -85,7 +82,7 @@ process_repo() {
echo "Checking for blacklist files in $repo_identifer" echo "Checking for blacklist files in $repo_identifer"
find . | while read -r file; do while read -r file; do
if [ -z "$file" ]; then if [ -z "$file" ]; then
continue continue
fi fi
...@@ -94,13 +91,13 @@ process_repo() { ...@@ -94,13 +91,13 @@ process_repo() {
cd "$current_path" cd "$current_path"
return return
fi fi
done done < <(find .)
cd "$current_path" cd "$current_path"
echo "Checking for OCG codes in $repo_identifer" echo "Checking for OCG codes in $repo_identifer"
ls -1 workspace/$repo_identifer/*.cdb | xargs -I '{}' sqlite3 '{}' 'select id from datas;' | while read -r code; do while read -r code; do
if [ -z "$code" ]; then if [ -z "$code" ]; then
continue continue
fi fi
...@@ -108,7 +105,7 @@ process_repo() { ...@@ -108,7 +105,7 @@ process_repo() {
echo "Skipping $repo_identifer due to using OCG code $code" echo "Skipping $repo_identifer due to using OCG code $code"
return return
fi fi
done done < <(ls -1 workspace/$repo_identifer/*.cdb | xargs -I '{}' sqlite3 '{}' 'select id from datas;')
# fetch previous hash # fetch previous hash
previous_hash=$(curl -sL "https://cdn02.moecube.com:444/ygopro-custom-free/content/hashes/$repo_identifer.txt" || true) previous_hash=$(curl -sL "https://cdn02.moecube.com:444/ygopro-custom-free/content/hashes/$repo_identifer.txt" || true)
...@@ -144,7 +141,7 @@ process_repo() { ...@@ -144,7 +141,7 @@ process_repo() {
echo "Checking for used codes in $repo_identifer" echo "Checking for used codes in $repo_identifer"
# add the codes to the used_codes array # add the codes to the used_codes array
ls -1 workspace/$repo_identifer/*.cdb | xargs -I '{}' sqlite3 '{}' 'select id from datas;' | while read -r code; do while read -r code; do
if [ -z "$code" ]; then if [ -z "$code" ]; then
continue continue
fi fi
...@@ -154,7 +151,7 @@ process_repo() { ...@@ -154,7 +151,7 @@ process_repo() {
else else
used_codes[$code]="$repo_url" used_codes[$code]="$repo_url"
fi fi
done done < <(ls -1 workspace/$repo_identifer/*.cdb | xargs -I '{}' sqlite3 '{}' 'select id from datas;')
echo "Archiving $repo_identifer" echo "Archiving $repo_identifer"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment