DKL9 GitList
Repositories
DKL9 home
memoire
Code
Commits
Branches
Tags
Search
Tree:
b39812d
Branches
Tags
master
memoire
src
imgrefcheck.lua
Reformulate data structures
John Smith
commited
b39812d
at 2023-177 12:35:37
imgrefcheck.lua
Blame
History
Raw
local function fn(config, deck, deckfname) local mcl = {} for i, card in ipairs(deck) do for path in card.note:gmatch(IMG_PATTERN) do local fh = io.open((deckfname:match(".*/") or "") .. path, "r") if not fh then table.insert(mcl, i) break end end end if #mcl >= 1 then io.write(string.format("Found %d card%s with bad image references:\n", #mcl, #mcl == 1 and "" or "s")) else io.write(string.format("No cards with bad image references\n")) end for _, i in ipairs(mcl) do io.write(string.format("%d %s\n", i, deck[i].note)) end end return { desc = "(i)mage reference check", nd = true, fn = fn }