diff --git a/strange_eons_to_arkhamdb.js b/strange_eons_to_arkhamdb.js index 33a2774..f262996 100644 --- a/strange_eons_to_arkhamdb.js +++ b/strange_eons_to_arkhamdb.js @@ -260,9 +260,13 @@ for (let member in recurseAllChildren(Eons.getOpenProject())) { let card_data = build_card(component); cards.push(card_data); - const export_dir = new File(member.parent.file, 'export'); - export_dir.mkdir(); - exportCard(component, new File(export_dir, card_data.code + '.png')); + let export_dir = new File(member.parent.file, 'export'); + let target_file = new File(export_dir, card_data.code + '.png'); + if (!target_file.exists() || member.file.lastModified() > target_file.lastModified()) { + printf("Image for '%s' is out of date, rebuilding...\n", member); + export_dir.mkdir(); + exportCard(component, target_file); + } } } } catch (ex) {