Use `ProjectUtilities.writeTextFile​` to save JSON file

This commit is contained in:
Adam Goldsmith 2021-09-15 15:02:45 -04:00
parent 11cd73c70b
commit df51724b59
1 changed files with 1 additions and 4 deletions

View File

@ -277,10 +277,7 @@ cards.sort(function (a, b) {
});
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();
ProjectUtilities.writeTextFile(file, JSON.stringify(cards, null, 4));
println("Done!");
Eons.getOpenProject().synchronize();