add rules to fix image and update image script
parent
0843f044a5
commit
70532664f7
8
Makefile
8
Makefile
|
@ -928,3 +928,11 @@ github-releases.json:
|
|||
correct-release-label:
|
||||
curl -XPATCH https://api.github.com/repos/magarena/magarena/releases/assets/${mac} -H"Content-Type: application/json" -d'{"name": "Magarena-${tag}.app.zip", "label":"Magarena-${tag}.app.zip for Mac"}' -u ${username}
|
||||
curl -XPATCH https://api.github.com/repos/magarena/magarena/releases/assets/${linux} -H"Content-Type: application/json" -d'{"name": "Magarena-${tag}.zip", "label":"Magarena-${tag}.zip for Linux/Windows"}' -u ${username}
|
||||
|
||||
%_img.tsv:
|
||||
paste <(cat conspiracy-take-crown | pup 'img attr{alt}') <(cat conspiracy-take-crown | pup 'img attr{src}') > $@
|
||||
# edit tsv file to use only ASCII characters
|
||||
|
||||
%_fix_image:
|
||||
grep /$*/ -r release/Magarena/scripts_missing release/Magarena/scripts -l | parallel awk -f scripts/update_image.awk $*_img.tsv {} '>' {}.new
|
||||
grep /$*/ -r release/Magarena/scripts_missing/*.txt release/Magarena/scripts/*.txt -l | parallel mv {}.new {}
|
||||
|
|
|
@ -20,14 +20,7 @@ NF == 2 {
|
|||
}
|
||||
|
||||
/^image=/ {
|
||||
old_set = gensub("image=","","g", $0)
|
||||
new_set = gensub("http://magiccards.info/scans/en/", "", "g", image)
|
||||
new_set = gensub("/[^/]*.jpg", "", "g", new_set)
|
||||
if (old_set == new_set) {
|
||||
print "image=" image
|
||||
} else {
|
||||
print $0
|
||||
}
|
||||
print "image=" image
|
||||
next
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue