Only re-export image if the source file is newer than the image
This commit is contained in:
parent
5fa9bf0cdd
commit
640c8d9733
@ -260,9 +260,13 @@ for (let member in recurseAllChildren(Eons.getOpenProject())) {
|
|||||||
let card_data = build_card(component);
|
let card_data = build_card(component);
|
||||||
cards.push(card_data);
|
cards.push(card_data);
|
||||||
|
|
||||||
const export_dir = new File(member.parent.file, 'export');
|
let export_dir = new File(member.parent.file, 'export');
|
||||||
export_dir.mkdir();
|
let target_file = new File(export_dir, card_data.code + '.png');
|
||||||
exportCard(component, 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) {
|
} catch (ex) {
|
||||||
|
Loading…
Reference in New Issue
Block a user