Write arkhamdb json output to a file
This commit is contained in:
parent
c3051b19d2
commit
ad4e082012
@ -1,3 +1,5 @@
|
|||||||
|
importClass(java.io.File);
|
||||||
|
importClass(java.io.FileWriter);
|
||||||
importPackage(arkham.project);
|
importPackage(arkham.project);
|
||||||
|
|
||||||
// TODO: should be defined in strange eons somewhere
|
// TODO: should be defined in strange eons somewhere
|
||||||
@ -246,4 +248,12 @@ for (let member in recurseAllChildren(Eons.getOpenProject())) {
|
|||||||
cards.sort(function (a, b) {
|
cards.sort(function (a, b) {
|
||||||
return parseInt(a.code) - parseInt(b.code);
|
return parseInt(a.code) - parseInt(b.code);
|
||||||
});
|
});
|
||||||
println(JSON.stringify(cards, null, 4));
|
const file = new File(Eons.getOpenProject().getFile(), pack_code + '.json');
|
||||||
|
printf("Writing '%s'\n", file);
|
||||||
|
const file_writer = new FileWriter(file);
|
||||||
|
file_writer.write(JSON.stringify(cards, null, 4));
|
||||||
|
file_writer.flush();
|
||||||
|
file_writer.close();
|
||||||
|
println("Done!");
|
||||||
|
|
||||||
|
Eons.getOpenProject().synchronize();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user