From df51724b593d7439162eea6ecce5a84083575fbb Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 15 Sep 2021 15:02:45 -0400 Subject: [PATCH] =?UTF-8?q?Use=20`ProjectUtilities.writeTextFile=E2=80=8B`?= =?UTF-8?q?=20to=20save=20JSON=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- strange_eons_to_arkhamdb.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/strange_eons_to_arkhamdb.js b/strange_eons_to_arkhamdb.js index 27fe1ea..1b49aea 100644 --- a/strange_eons_to_arkhamdb.js +++ b/strange_eons_to_arkhamdb.js @@ -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();